Search in sources :

Example 1 with ByteOpenHashSet

use of it.unimi.dsi.fastutil.bytes.ByteOpenHashSet in project symja_android_library by axkr.

the class ByteDictionaryMap method selectIsIn.

@Override
public Selection selectIsIn(String... strings) {
    ByteOpenHashSet keys = new ByteOpenHashSet();
    for (String string : strings) {
        byte 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.getByte(i))) {
            results.add(i);
        }
    }
    return results;
}
Also used : BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) Selection(tech.tablesaw.selection.Selection) BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) ByteOpenHashSet(it.unimi.dsi.fastutil.bytes.ByteOpenHashSet)

Example 2 with ByteOpenHashSet

use of it.unimi.dsi.fastutil.bytes.ByteOpenHashSet in project symja_android_library by axkr.

the class ByteDictionaryMap method selectIsIn.

@Override
public Selection selectIsIn(Collection<String> strings) {
    ByteOpenHashSet keys = new ByteOpenHashSet();
    for (String string : strings) {
        byte 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.getByte(i))) {
            results.add(i);
        }
    }
    return results;
}
Also used : BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) Selection(tech.tablesaw.selection.Selection) BitmapBackedSelection(tech.tablesaw.selection.BitmapBackedSelection) ByteOpenHashSet(it.unimi.dsi.fastutil.bytes.ByteOpenHashSet)

Example 3 with ByteOpenHashSet

use of it.unimi.dsi.fastutil.bytes.ByteOpenHashSet in project symja_android_library by axkr.

the class BooleanColumn method unique.

@Override
public BooleanColumn unique() {
    ByteSet count = new ByteOpenHashSet(3);
    for (byte next : data) {
        count.add(next);
    }
    ByteArrayList list = new ByteArrayList(count);
    return new BooleanColumn(name() + " Unique values", list);
}
Also used : ByteArrayList(it.unimi.dsi.fastutil.bytes.ByteArrayList) ByteSet(it.unimi.dsi.fastutil.bytes.ByteSet) ByteOpenHashSet(it.unimi.dsi.fastutil.bytes.ByteOpenHashSet)

Aggregations

ByteOpenHashSet (it.unimi.dsi.fastutil.bytes.ByteOpenHashSet)3 BitmapBackedSelection (tech.tablesaw.selection.BitmapBackedSelection)2 Selection (tech.tablesaw.selection.Selection)2 ByteArrayList (it.unimi.dsi.fastutil.bytes.ByteArrayList)1 ByteSet (it.unimi.dsi.fastutil.bytes.ByteSet)1