Search in sources :

Example 21 with IntIterator

use of it.unimi.dsi.fastutil.ints.IntIterator in project angel by Tencent.

the class MatrixClientAdapter method findNewRows.

private RowIndex findNewRows(RowIndex rowIndex) {
    IntOpenHashSet need = new IntOpenHashSet();
    IntOpenHashSet fetchingRowIds = fetchingRowSets.get(rowIndex.getMatrixId());
    IntIterator iter = rowIndex.getRowIds().iterator();
    while (iter.hasNext()) {
        int rowId = iter.nextInt();
        if (!fetchingRowIds.contains(rowId)) {
            need.add(rowId);
            fetchingRowIds.add(rowId);
        }
    }
    return new RowIndex(rowIndex.getMatrixId(), need, rowIndex);
}
Also used : IntOpenHashSet(it.unimi.dsi.fastutil.ints.IntOpenHashSet) IntIterator(it.unimi.dsi.fastutil.ints.IntIterator)

Example 22 with IntIterator

use of it.unimi.dsi.fastutil.ints.IntIterator in project angel by Tencent.

the class RowIndex method listRowIds.

public String listRowIds() {
    int[] idList = new int[rowIdSet.size()];
    IntIterator iter = rowIdSet.iterator();
    int i = 0;
    while (iter.hasNext()) {
        idList[i++] = iter.nextInt();
    }
    Arrays.sort(idList);
    StringBuilder sb = new StringBuilder();
    for (i = 0; i < idList.length; i++) {
        sb.append(idList[i]);
        sb.append(",");
    }
    return sb.toString();
}
Also used : IntIterator(it.unimi.dsi.fastutil.ints.IntIterator)

Example 23 with IntIterator

use of it.unimi.dsi.fastutil.ints.IntIterator in project angel by Tencent.

the class RowUpdateInfo method getMinClock.

/**
 * Get min clock of this row, remove clocks of tasks which would never update this row.
 *
 * @return min clock value
 */
public int getMinClock() {
    if (clocks.size() == 0) {
        return 0;
    }
    IntIterator iter = clocks.values().iterator();
    int min = Integer.MAX_VALUE;
    while (iter.hasNext()) {
        int clock = iter.nextInt();
        if (clock < min) {
            min = clock;
        }
    }
    return min;
}
Also used : IntIterator(it.unimi.dsi.fastutil.ints.IntIterator)

Example 24 with IntIterator

use of it.unimi.dsi.fastutil.ints.IntIterator in project symja_android_library by axkr.

the class DateColumn method removeMissing.

@Override
public DateColumn removeMissing() {
    DateColumn noMissing = emptyCopy();
    IntIterator iterator = intIterator();
    while (iterator.hasNext()) {
        int i = iterator.nextInt();
        if (!valueIsMissing(i)) {
            noMissing.appendInternal(i);
        }
    }
    return noMissing;
}
Also used : IntIterator(it.unimi.dsi.fastutil.ints.IntIterator)

Example 25 with IntIterator

use of it.unimi.dsi.fastutil.ints.IntIterator in project symja_android_library by axkr.

the class DateFilters method eval.

default Selection eval(IntBiPredicate predicate, int value) {
    Selection selection = new BitmapBackedSelection();
    IntIterator iterator = intIterator();
    int idx = 0;
    while (iterator.hasNext()) {
        int next = iterator.nextInt();
        if (predicate.test(next, value)) {
            selection.add(idx);
        }
        idx++;
    }
    return selection;
}
Also used : IntIterator(it.unimi.dsi.fastutil.ints.IntIterator) BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) Selection(tech.tablesaw.selection.Selection) BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection)

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