set.addAll(activeLandmarkIndices); int existingLandmarkCounter = 0; final int COUNT = Math.min(activeLandmarkIndices.length - 2, 2);
private void propagateAlongDAG() { for (int i = propagationPath.length - 1; i >= 0; --i) { int node = propagationPath[i]; boolean predecessorsChanged = false; for (int predecessor : graph.incomingEdges(node)) { if (formerNodeChanged[predecessor] || nodeChanged[predecessor]) { predecessorsChanged = true; break; } } if (!predecessorsChanged) { continue; } IntHashSet nodeTypes = getNodeTypes(node); for (int predecessor : graph.incomingEdges(node)) { if (formerNodeChanged[predecessor] || nodeChanged[predecessor]) { if (nodeTypes.addAll(types[predecessor]) > 0) { nodeChanged[node] = true; changed = true; } } } } }
getNodeTypes(node).addAll(typesBackup[i]);
/** * New instance copying elements from another {@link IntContainer}. */ public IntHashSet(IntContainer container) { this(container.size()); addAll(container); }
/** * Create a set from a variable number of arguments or an array of * <code>int</code>. The elements are copied from the argument to the * internal buffer. */ /* */ public static IntHashSet from(int... elements) { final IntHashSet set = new IntHashSet(elements.length); set.addAll(elements); return set; }
/** * Adds all elements from the given {@link IntContainer} to this set. * * @return Returns the number of elements actually added as a result of this * call (not previously present in the set). */ public int addAll(IntContainer container) { ensureCapacity(container.size()); return addAll((Iterable<? extends IntCursor>) container); }
public void addAll(IntHashSet set) { super.addAll(set); } }
@Override protected void addAll(TermsSet terms) { if (!(terms instanceof IntegerTermsSet)) { throw new UnsupportedOperationException("Invalid type: IntegerTermsSet expected."); } this.set.addAll(((IntegerTermsSet) terms).set); }
/** * New instance copying elements from another {@link IntContainer}. */ public IntHashSet(IntContainer container) { this(container.size()); addAll(container); }
/** * Create a set from a variable number of arguments or an array of * <code>int</code>. The elements are copied from the argument to the * internal buffer. */ /* */ public static IntHashSet from(int... elements) { final IntHashSet set = new IntHashSet(elements.length); set.addAll(elements); return set; }
public static void main(String[] args) { final long start = System.currentTimeMillis(); final IntHashSet a = new com.carrotsearch.hppc.IntHashSet(); for( int i = 10000000; i-- != 0; ) a.add(i); IntHashSet b = new com.carrotsearch.hppc.IntHashSet(a.size()); b.addAll(a); b = new com.carrotsearch.hppc.IntHashSet(); b.addAll(a); final long time = System.currentTimeMillis() - start; System.out.println( time / 1000.0 ); System.out.println( b.size() ); } }
/** * Adds all elements from the given {@link IntContainer} to this set. * * @return Returns the number of elements actually added as a result of this * call (not previously present in the set). */ public int addAll(IntContainer container) { ensureCapacity(container.size()); return addAll((Iterable<? extends IntCursor>) container); }
set.addAll(activeLandmarkIndices); int existingLandmarkCounter = 0; final int COUNT = Math.min(activeLandmarkIndices.length - 2, 2);
set.addAll(activeLandmarkIndices); int existingLandmarkCounter = 0; final int COUNT = Math.min(activeLandmarkIndices.length - 2, 2);