use of it.unimi.dsi.fastutil.ints.IntSet in project symja_android_library by axkr.
the class TimeColumn method unique.
@Override
public TimeColumn unique() {
IntSet ints = new IntOpenHashSet(data);
TimeColumn column = emptyCopy(ints.size());
column.data = IntArrayList.wrap(ints.toIntArray());
column.setName(name() + " Unique values");
return column;
}
use of it.unimi.dsi.fastutil.ints.IntSet in project symja_android_library by axkr.
the class DateColumn method unique.
@Override
public DateColumn unique() {
IntSet ints = new IntOpenHashSet(data.size());
for (int i = 0; i < size(); i++) {
ints.add(data.getInt(i));
}
DateColumn copy = emptyCopy(ints.size());
copy.setName(name() + " Unique values");
copy.data = IntArrayList.wrap(ints.toIntArray());
return copy;
}
use of it.unimi.dsi.fastutil.ints.IntSet in project druid by druid-io.
the class BitmapBenchmarkWithVaryingOrder method setup.
@Setup(Level.Trial)
public void setup() throws IOException {
switch(type) {
case "concise":
bitmapFactory = new ConciseBitmapFactory();
break;
case "roaring":
bitmapFactory = new RoaringBitmapFactory();
break;
default:
throw new IAE("Unknown bitmap type[%s]", type);
}
bitmaps = new ArrayList<>(numBitmaps);
// Bitmaps usually have a short circuit to early return an empty bitmap if it finds no intersection
// during an AND operation. We want to let them iterate all bitmaps instead, so add some bits that
// will be set for all bitmaps we create.
final int[] knownTrue = new int[minIntersect];
for (int i = 0; i < knownTrue.length; ++i) {
knownTrue[i] = RANDOM.nextInt(bitmapLength);
}
for (int i = 0; i < numBitmaps; ++i) {
// the later the bitmap is created, the higher its density is.
final int bitCount = (int) (i * 0.1);
IntSet ints = new IntOpenHashSet(bitCount);
for (int j = 0; j < bitCount; j++) {
int offset;
do {
offset = RANDOM.nextInt(bitmapLength);
} while (ints.contains(offset));
ints.add(offset);
}
final MutableBitmap mutableBitmap = bitmapFactory.makeEmptyMutableBitmap();
ints.iterator().forEachRemaining((IntConsumer) mutableBitmap::add);
for (int k : knownTrue) {
mutableBitmap.add(k);
}
bitmaps.add(BitmapBenchmarkUtils.toOffheap(bitmapFactory.makeImmutableBitmap(mutableBitmap)));
}
reverseBitmaps = Lists.reverse(bitmaps);
}
use of it.unimi.dsi.fastutil.ints.IntSet in project gradle by gradle.
the class IntSetSerializer method read.
@Override
public IntSet read(Decoder decoder) throws EOFException, Exception {
int size = decoder.readInt();
if (size == 0) {
return IntSets.EMPTY_SET;
}
IntSet result = new IntOpenHashSet(size);
for (int i = 0; i < size; i++) {
result.add(decoder.readInt());
}
return result;
}
use of it.unimi.dsi.fastutil.ints.IntSet in project gradle by gradle.
the class ClassSetAnalysis method findChangedConstants.
private Map<String, IntSet> findChangedConstants(ClassSetAnalysis other, DependentsSet affectedClasses) {
if (affectedClasses.isDependencyToAll()) {
return Collections.emptyMap();
}
Set<String> dependentClasses = affectedClasses.getAllDependentClasses();
Map<String, IntSet> result = new HashMap<>(dependentClasses.size());
for (String affectedClass : dependentClasses) {
IntSet difference = new IntOpenHashSet(other.getConstants(affectedClass));
difference.removeAll(getConstants(affectedClass));
result.put(affectedClass, difference);
}
return result;
}
Aggregations