Search in sources :

Example 31 with IntIterator

use of it.unimi.dsi.fastutil.ints.IntIterator in project ignite by apache.

the class SparseMatrix method nonZeroElements.

/**
 * {@inheritDoc}
 */
@Override
public int nonZeroElements() {
    int res = 0;
    IntIterator rowIter = indexesMap().keySet().iterator();
    while (rowIter.hasNext()) {
        int row = rowIter.nextInt();
        res += indexesMap().get(row).size();
    }
    return res;
}
Also used : IntIterator(it.unimi.dsi.fastutil.ints.IntIterator)

Aggregations

IntIterator (it.unimi.dsi.fastutil.ints.IntIterator)31 ArrayList (java.util.ArrayList)5 Test (org.junit.Test)4 IntOpenHashSet (it.unimi.dsi.fastutil.ints.IntOpenHashSet)3 Centroid (de.lmu.ifi.dbs.elki.math.linearalgebra.Centroid)2 IntArrayList (it.unimi.dsi.fastutil.ints.IntArrayList)2 BitmapBackedSelection (tech.tablesaw.selection.BitmapBackedSelection)2 Selection (tech.tablesaw.selection.Selection)2 PartitionKey (com.tencent.angel.PartitionKey)1 MatrixMeta (com.tencent.angel.ml.matrix.MatrixMeta)1 ClassLabel (de.lmu.ifi.dbs.elki.data.ClassLabel)1 NumberVector (de.lmu.ifi.dbs.elki.data.NumberVector)1 Model (de.lmu.ifi.dbs.elki.data.model.Model)1 GeneratorSingleCluster (de.lmu.ifi.dbs.elki.data.synthetic.bymodel.GeneratorSingleCluster)1 LeafEntry (de.lmu.ifi.dbs.elki.index.tree.LeafEntry)1 XTreeDirectoryEntry (de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.xtree.XTreeDirectoryEntry)1 FiniteProgress (de.lmu.ifi.dbs.elki.logging.progress.FiniteProgress)1 LongStatistic (de.lmu.ifi.dbs.elki.logging.statistics.LongStatistic)1 CovarianceMatrix (de.lmu.ifi.dbs.elki.math.linearalgebra.CovarianceMatrix)1 EigenvalueDecomposition (de.lmu.ifi.dbs.elki.math.linearalgebra.EigenvalueDecomposition)1