Search in sources :

Example 31 with IntOpenHashSet

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

the class IntDictionaryMap method selectIsIn.

@Override
public Selection selectIsIn(String... strings) {
    IntOpenHashSet keys = new IntOpenHashSet(strings.length);
    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 32 with IntOpenHashSet

use of it.unimi.dsi.fastutil.ints.IntOpenHashSet 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)

Aggregations

IntOpenHashSet (it.unimi.dsi.fastutil.ints.IntOpenHashSet)32 IntSet (it.unimi.dsi.fastutil.ints.IntSet)11 IntIterator (it.unimi.dsi.fastutil.ints.IntIterator)4 PartitionKey (com.tencent.angel.PartitionKey)3 ArrayList (java.util.ArrayList)3 Random (java.util.Random)3 Supplier (com.google.common.base.Supplier)2 FieldSpec (com.linkedin.pinot.common.data.FieldSpec)2 IntArrayList (it.unimi.dsi.fastutil.ints.IntArrayList)2 IAE (org.apache.druid.java.util.common.IAE)2 BitmapBackedSelection (tech.tablesaw.selection.BitmapBackedSelection)2 Selection (tech.tablesaw.selection.Selection)2 JsonCreator (com.fasterxml.jackson.annotation.JsonCreator)1 JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)1 JsonInclude (com.fasterxml.jackson.annotation.JsonInclude)1 JsonProperty (com.fasterxml.jackson.annotation.JsonProperty)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 Joiner (com.google.common.base.Joiner)1 Preconditions (com.google.common.base.Preconditions)1 Predicate (com.google.common.base.Predicate)1