use of it.unimi.dsi.fastutil.longs.LongOpenHashSet in project symja_android_library by axkr.
the class InstantColumn method unique.
@Override
public InstantColumn unique() {
LongSet ints = new LongOpenHashSet(data.size());
for (long i : data) {
ints.add(i);
}
InstantColumn column = emptyCopy(ints.size());
column.setName(name() + " Unique values");
column.data = LongArrayList.wrap(ints.toLongArray());
return column;
}
use of it.unimi.dsi.fastutil.longs.LongOpenHashSet in project druid by druid-io.
the class InDimFilter method createLongPredicate.
private static DruidLongPredicate createLongPredicate(final Set<String> values) {
LongArrayList longs = new LongArrayList(values.size());
for (String value : values) {
final Long longValue = DimensionHandlerUtils.convertObjectToLong(value);
if (longValue != null) {
longs.add((long) longValue);
}
}
final LongOpenHashSet longHashSet = new LongOpenHashSet(longs);
return longHashSet::contains;
}
use of it.unimi.dsi.fastutil.longs.LongOpenHashSet in project druid by druid-io.
the class InDimFilter method createDoublePredicate.
private static DruidDoublePredicate createDoublePredicate(final Set<String> values) {
LongArrayList doubleBits = new LongArrayList(values.size());
for (String value : values) {
Double doubleValue = DimensionHandlerUtils.convertObjectToDouble(value);
if (doubleValue != null) {
doubleBits.add(Double.doubleToLongBits((doubleValue)));
}
}
final LongOpenHashSet doubleBitsHashSet = new LongOpenHashSet(doubleBits);
return input -> doubleBitsHashSet.contains(Double.doubleToLongBits(input));
}
use of it.unimi.dsi.fastutil.longs.LongOpenHashSet in project RecurrentComplex by Ivorforce.
the class MapGenStructureHook method generate.
@Override
public void generate(World worldIn, int x, int z, ChunkPrimer primer) {
this.world = worldIn;
WorldServer server = (WorldServer) worldIn;
this.rand.setSeed(worldIn.getSeed());
long j = this.rand.nextLong();
long k = this.rand.nextLong();
initializeStructureData(base, world);
Long2ObjectMap<StructureStart> map = getStructureMap(base);
LongSet before = new LongOpenHashSet(map.keySet());
base.generate(worldIn, x, z, primer);
Sets.newHashSet(Collections2.filter(map.keySet(), Predicates.not(Predicates.in(before)))).forEach(key -> {
StructureStart start = map.get(key);
if (start.isSizeableStructure()) {
this.rand.setSeed((j * start.getChunkPosX()) ^ (k * start.getChunkPosZ()) ^ worldIn.getSeed());
Pair<Structure<?>, VanillaDecorationGeneration> selected = RCBiomeDecorator.selectDecoration(server, rand, new BlockPos(start.getChunkPosX() * 16, 0, start.getChunkPosZ() * 16), getDecorationType(start));
if (// > 1 we can't handle yet...
selected != null) {
// int minY = start.getComponents().get(0).getBoundingBox().minY;
// We don't want this anymore.
// Don't just remove it from the list lest it get added again
// Instead remove all components so it doesn't generate anything
start.getComponents().clear();
setStructureStart(base, start.getChunkPosX(), start.getChunkPosZ(), start);
// Gen ours
// Do this AFTER clearing because of chained chunk gen
// HACKY This is important because technically we're in the planning phase and not allowed to gen
RCBiomeDecorator.generate(selected, server, new ChunkPos(start.getChunkPosX(), start.getChunkPosZ()), rand);
}
}
});
}
use of it.unimi.dsi.fastutil.longs.LongOpenHashSet in project geode by apache.
the class DiskInitFile method calcMissing.
private LongOpenHashSet calcMissing(LongOpenHashSet found, LongOpenHashSet expected) {
LongOpenHashSet missing = new LongOpenHashSet(expected);
missing.removeAll(found);
return missing;
}
Aggregations