COLT website上的代码示例显示:
DoubleFactory2D factory;
factory = DoubleFactory2D.sparse;
DoubleMatrix2D matrix = factory.make(3,4);
for (int row = matrix.rows(); --row >= 0;) {
for (int column = matrix.columns(); --column >= 0;) {
value = matrix.getQuick(row, column);
}
}
但这并没有利用矩阵的稀疏性。我只想迭代非零值。