public ColtHashSet( int initialCapacity, double minLoadFactor, double maxLoadFactor ) { map = new OpenLongObjectHashMap( initialCapacity, minLoadFactor, maxLoadFactor ); }
public ColtHashSet(int initialCapacity) { map = new OpenLongObjectHashMap(initialCapacity); }
public ColtLongHashSet(int initialCapacity) { this.map = new OpenLongObjectHashMap(initialCapacity); }
@Override public SnapshotableSet<Long> create() { if (numberType == NumberType.INTEGER) { return new ColtIntegerHashSet( new OpenIntObjectHashMap(initialValue, minLoadFactor, maxLoadFactor) ); } else if (numberType == NumberType.LONG) { return new ColtLongHashSet( new OpenLongObjectHashMap(initialValue, minLoadFactor, maxLoadFactor) ); } else { throw new IllegalStateException(String.format("unknown type %s", numberType)); } } }
public SimpleFormula(IPermutation permutation) { this.permutation = permutation; tiers = new ObjectArrayList(); tiersHash3 = new OpenLongObjectHashMap(); }
public SimpleFormula() { permutation = new SimplePermutation(); tiers = new ObjectArrayList(); tiersHash1 = new OpenIntObjectHashMap(); tiersHash2 = new OpenLongObjectHashMap(); tiersHash3 = new OpenLongObjectHashMap(); }
size = 10000000; final int modulo = 7; final AbstractLongObjectMap map = new OpenLongObjectHashMap(size); for (int i = 1; i <= size; i++) { map.put(size, "O" + i);
private static long testByte() { AbstractLongObjectMap tx = new OpenLongObjectHashMap(NUM); for (int i = 0; i < NUM; i++) { tx.put(i, new ConcurrentSkipListSet<ByteEntry>()); } for (int i = 0; i < NUM; i++) { for (int j = 0; j < NUM; j++) { if (i == j) continue; if (Math.random() < FRACTION) { ByteBuffer key = ByteBuffer.allocate(16); key.putLong(5).putLong(j).flip(); ByteBuffer value = ByteBuffer.allocate(4); value.putInt(random.nextInt(ROUNDSIZE)).flip(); ((ConcurrentSkipListSet<ByteEntry>) tx.get(i)).add(new ByteEntry(key, value)); } } } long time = System.currentTimeMillis(); long sum = 0; for (int t = 0; t < TRIALS; t++) { for (int i = 0; i < NUM; i++) { for (Vertex v : (new ByteVertex(i, tx)).getNeighbors(0)) { sum += v.getId(); } } } time = System.currentTimeMillis() - time; return time; }
/** * Creates copy of <code>formula</code>. * * New formula uses the same instance of <code>permutation</code> and cloned instances of tiers. * Be careful about modifying permutation of new formula, because these changes will also affect initial formula. * * @param formula */ private SimpleFormula(SimpleFormula formula, final boolean fillTiersHash3) { this.permutation = formula.permutation; int tiersCount = formula.tiers.size(); this.tiers = new ObjectArrayList(tiersCount); this.tiersHash3 = fillTiersHash3 ? new OpenLongObjectHashMap(tiersCount) : null; Object[] tiersElements = formula.tiers.elements(); for (int i = 0; i < tiersCount; i++) { ITier clone = ((ITier) tiersElements[i]).clone(); tiers.add(clone); if (fillTiersHash3) { tiersHash3.put(clone.canonicalHashCode(), clone); } } }