code: public double[][] toDenseArray() {
          double[][] m = new double[rows][cols];
  
          for (int r = 0; r < rows; ++r) 
              m[r] = toArray(rowToColumns.get(r), cols);
          return m;
      }
docs: {@inheritDoc}