Search in sources :

Example 76 with BitmapBackedSelection

use of tech.tablesaw.selection.BitmapBackedSelection in project symja_android_library by axkr.

the class IntDictionaryMap method isEqualTo.

@Override
public Selection isEqualTo(String string) {
    Selection results = new BitmapBackedSelection();
    int key = getKeyForValue(string);
    addValuesToSelection(results, key);
    return results;
}
Also used : BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) Selection(tech.tablesaw.selection.Selection) BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection)

Example 77 with BitmapBackedSelection

use of tech.tablesaw.selection.BitmapBackedSelection in project symja_android_library by axkr.

the class IntDictionaryMap method selectIsIn.

@Override
public Selection selectIsIn(Collection<String> strings) {
    IntOpenHashSet keys = new IntOpenHashSet(strings.size());
    for (String string : strings) {
        int key = getKeyForValue(string);
        if (key != DEFAULT_RETURN_VALUE) {
            keys.add(key);
        }
    }
    Selection results = new BitmapBackedSelection();
    for (int i = 0; i < values.size(); i++) {
        if (keys.contains(values.getInt(i))) {
            results.add(i);
        }
    }
    return results;
}
Also used : IntOpenHashSet(it.unimi.dsi.fastutil.ints.IntOpenHashSet) BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) Selection(tech.tablesaw.selection.Selection) BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection)

Example 78 with BitmapBackedSelection

use of tech.tablesaw.selection.BitmapBackedSelection in project symja_android_library by axkr.

the class StringFilters method isNotEqualTo.

default Selection isNotEqualTo(String string) {
    Selection selection = new BitmapBackedSelection();
    selection.addRange(0, size());
    selection.andNot(isEqualTo(string));
    return selection;
}
Also used : BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) Selection(tech.tablesaw.selection.Selection) BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection)

Example 79 with BitmapBackedSelection

use of tech.tablesaw.selection.BitmapBackedSelection 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

BitmapBackedSelection (tech.tablesaw.selection.BitmapBackedSelection)79 Selection (tech.tablesaw.selection.Selection)79 IntArrayList (it.unimi.dsi.fastutil.ints.IntArrayList)31 PivotTable (tech.tablesaw.aggregate.PivotTable)3 ByteOpenHashSet (it.unimi.dsi.fastutil.bytes.ByteOpenHashSet)2 IntIterator (it.unimi.dsi.fastutil.ints.IntIterator)2 IntOpenHashSet (it.unimi.dsi.fastutil.ints.IntOpenHashSet)2 ShortOpenHashSet (it.unimi.dsi.fastutil.shorts.ShortOpenHashSet)2 IExpr (org.matheclipse.core.interfaces.IExpr)2 ByteArrayList (it.unimi.dsi.fastutil.bytes.ByteArrayList)1 ByteIterator (it.unimi.dsi.fastutil.bytes.ByteIterator)1 IntRBTreeSet (it.unimi.dsi.fastutil.ints.IntRBTreeSet)1 ByteBuffer (java.nio.ByteBuffer)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 CategoricalColumn (tech.tablesaw.api.CategoricalColumn)1 DoubleColumn (tech.tablesaw.api.DoubleColumn)1 Column (tech.tablesaw.columns.Column)1