void schedulePropagation(Transition consumer, DependencyType[] types) { if (types.length == 0) { return; } if (types.length == 1) { schedulePropagation(consumer, types[0]); return; } if (consumer.pendingTypes == null && propagationDepth < PROPAGATION_STACK_THRESHOLD && consumer.pointsToDomainOrigin() && consumer.destination.propagateCount < 20) { ++propagationDepth; consumer.consume(types); --propagationDepth; } else { if (consumer.pendingTypes == null) { pendingTransitions.add(consumer); consumer.pendingTypes = new IntHashSet(Math.max(50, types.length)); } consumer.pendingTypes.ensureCapacity(types.length + consumer.pendingTypes.size()); for (DependencyType type : types) { consumer.pendingTypes.add(type.index); } } }
/** * {@inheritDoc} */ @Override public void release() { assigned = 0; hasEmptyKey = false; keys = null; ensureCapacity(Containers.DEFAULT_EXPECTED_ELEMENTS); }
/** * New instance with the provided defaults. * * @param expectedElements * The expected number of elements guaranteed not to cause a rehash (inclusive). * @param loadFactor * The load factor for internal buffers. Insane load factors (zero, full capacity) * are rejected by {@link #verifyLoadFactor(double)}. * @param orderMixer * Hash key order mixing strategy. See {@link HashOrderMixing} for predefined * implementations. Use constant mixers only if you understand the potential * consequences. */ public IntHashSet(int expectedElements, double loadFactor, HashOrderMixingStrategy orderMixer) { this.orderMixer = orderMixer; this.loadFactor = verifyLoadFactor(loadFactor); ensureCapacity(expectedElements); }
/** * Adds all elements from the given list (vararg) to this set. * * @return Returns the number of elements actually added as a result of this * call (not previously present in the set). */ /* */ public final int addAll(int... elements) { ensureCapacity(elements.length); int count = 0; for (int e : elements) { if (add(e)) { count++; } } return count; }
/** * 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); }
/** * {@inheritDoc} */ @Override public void release() { assigned = 0; hasEmptyKey = false; keys = null; ensureCapacity(Containers.DEFAULT_EXPECTED_ELEMENTS); }
/** * Adds all elements from the given list (vararg) to this set. * * @return Returns the number of elements actually added as a result of this * call (not previously present in the set). */ /* */ public final int addAll(int... elements) { ensureCapacity(elements.length); int count = 0; for (int e : elements) { if (add(e)) { count++; } } return count; }
/** * New instance with the provided defaults. * * @param expectedElements * The expected number of elements guaranteed not to cause a rehash (inclusive). * @param loadFactor * The load factor for internal buffers. Insane load factors (zero, full capacity) * are rejected by {@link #verifyLoadFactor(double)}. * @param orderMixer * Hash key order mixing strategy. See {@link HashOrderMixing} for predefined * implementations. Use constant mixers only if you understand the potential * consequences. */ public IntHashSet(int expectedElements, double loadFactor, HashOrderMixingStrategy orderMixer) { this.orderMixer = orderMixer; this.loadFactor = verifyLoadFactor(loadFactor); ensureCapacity(expectedElements); }
/** * 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); }
@Override public void afterHeuristicChange(boolean forward, boolean backward) { if (forward) { ignoreExplorationFrom.ensureCapacity(bestWeightMapFrom.size()); bestWeightMapFrom.forEach(new IntObjectPredicate<AStarEntry>() { @Override ignoreExplorationTo.ensureCapacity(bestWeightMapTo.size()); bestWeightMapTo.forEach(new IntObjectPredicate<AStarEntry>() { @Override