1

The code example on the COLT website shows:

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);
     }
    }

but this does not take advantage of the sparsity of the matrix. I'd like to iterate over non zero values only.

seinecle
  • 10,118
  • 14
  • 61
  • 120
  • If anybody reads this, I finally switched to an array of sparsevectors, because this data structure in Colt has a `getIndex()` method which returns the non zero elements of the vector. – seinecle Aug 04 '17 at 08:35

0 Answers0