CapacityBalancingEvictor(final double balance, final int balanceAfterNRepeatedQueries, final double loadFactor, final int initialCapacity) { super(initialCapacity, loadFactor); this.quantileEstimator_ = new QuantileEstimator(balance, initialCapacity); this.balanceAfterNRepeatedQueries_ = balanceAfterNRepeatedQueries; this.nRepeatedQueriesToBalance_ = balanceAfterNRepeatedQueries; this.stats = new Stats(); }
public void initDeletions() { this.removedContextInitRules_ = null; this.todoDeletions_ = new ArrayHashSet<CachedIndexedObject<?>>(1024); this.removedContextRuleHeadByClassExpressions_ = new ArrayHashMap<ModifiableIndexedClassExpression, ChainableSubsumerRule>( 32); this.removedDefinitions_ = new ArrayHashMap<ModifiableIndexedClass, ModifiableIndexedClassExpression>( 32); this.removedDefinitionReasons_ = new ArrayHashMap<ModifiableIndexedClass, ElkAxiom>( 32); }
@SuppressWarnings("unchecked") @Override public Iterator<E> iterator() { try { // create a more efficient iterator if the set supports direct // access return new RawSetIntersectionIterator<E>( ((DirectAccess<E>) smallSet).getRawData(), largeSet); } catch (ClassCastException e) { // resort to generic set intersection otherwise return new SetIntersectionIterator<E>(smallSet, largeSet); } }
private static <E> int removeMask(byte sl, E[] data, int[] masks, Object o, int mask) { int pos = LinearProbing.getPosition(data, o); if (data[pos] == null) return 0; // else int oldFragment = getFragment(sl, masks, pos); int newFragment = oldFragment & (~mask); if (newFragment == 0) remove(sl, data, masks, pos); else changeFragment(sl, masks, pos, oldFragment ^ newFragment); return oldFragment; }
@Override public void add(ForwardLinkMatch3 conclusion, ForwardLinkMatch3Watch inference) { watchedInferences_.add(conclusion, inference); }
private static <E> void remove(byte sl, E[] data, int[] masks, int pos) { int oldFragment = getFragment(sl, masks, pos); for (;;) { int next = LinearProbing.getMovedPosition(data, pos); E moved = data[pos] = data[next]; int newFragment = getFragment(sl, masks, next); changeFragment(sl, masks, pos, oldFragment ^ newFragment); if (moved == null) return; // else pos = next; oldFragment = newFragment; } }
private static <E> int addMask(byte sl, E[] data, int[] masks, E e, int mask) { int pos = LinearProbing.getPosition(data, e); int oldMask = getFragment(sl, masks, pos); if (data[pos] == null) { data[pos] = e; changeFragment(sl, masks, pos, oldMask ^ mask); return 0; } // else int newMask = (oldMask | mask); if (newMask != oldMask) changeFragment(sl, masks, pos, oldMask ^ newMask); return oldMask; }
private Collection<? extends InferenceMatch> getWatchInferences( ConclusionMatch conclusion) { // need this method since some java compilers have problems for casting // directly return watchedInferences_.get(conclusion); }
/** * @return A {@link Multimap} from R to S such that ObjectPropertyChain(R, * root) is a subrole of S, non-redundant ones */ public Multimap<IndexedObjectProperty, IndexedComplexPropertyChain> getNonRedundantCompositionsByLeftSubProperty() { return nonRedundantCompositionsByLeftSubProperty == null ? Operations .<IndexedObjectProperty, IndexedComplexPropertyChain> emptyMultimap() : nonRedundantCompositionsByLeftSubProperty; }
public void initDeletions() { this.removedContextInitRules_ = null; this.todoDeletions_ = new ArrayHashSet<CachedIndexedObject<?>>(1024); this.removedContextRuleHeadByClassExpressions_ = new ArrayHashMap<ModifiableIndexedClassExpression, ChainableSubsumerRule>( 32); this.removedDefinitions_ = new ArrayHashMap<ModifiableIndexedClass, ModifiableIndexedClassExpression>( 32); this.removedDefinitionReasons_ = new ArrayHashMap<ModifiableIndexedClass, ElkAxiom>( 32); }
@SuppressWarnings("unchecked") @Override public Iterator<E> iterator() { try { // create a more efficient iterator if the set supports direct // access return new RawSetIntersectionIterator<E>( ((DirectAccess<E>) smallSet).getRawData(), largeSet); } catch (ClassCastException e) { // resort to generic set intersection otherwise return new SetIntersectionIterator<E>(smallSet, largeSet); } }
@Override public void add(PropagationMatch1 conclusion, PropagationMatch1Watch inference) { watchedInferences_.add(conclusion, inference); }
CapacityBalancingEvictor(final double balance, final int balanceAfterNRepeatedQueries, final double loadFactor, final int initialCapacity) { super(initialCapacity, loadFactor); this.quantileEstimator_ = new QuantileEstimator(balance, initialCapacity); this.balanceAfterNRepeatedQueries_ = balanceAfterNRepeatedQueries; this.nRepeatedQueriesToBalance_ = balanceAfterNRepeatedQueries; this.stats = new Stats(); }
public void initDeletions() { this.removedContextInitRules_ = null; this.todoDeletions_ = new ArrayHashSet<CachedIndexedObject<?>>(1024); this.removedContextRuleHeadByClassExpressions_ = new ArrayHashMap<ModifiableIndexedClassExpression, ChainableSubsumerRule>( 32); this.removedDefinitions_ = new ArrayHashMap<ModifiableIndexedClass, ModifiableIndexedClassExpression>( 32); this.removedDefinitionReasons_ = new ArrayHashMap<ModifiableIndexedClass, ElkAxiom>( 32); }
@SuppressWarnings("unchecked") @Override public Iterator<E> iterator() { try { // create a more efficient iterator if the set supports direct // access return new RawSetIntersectionIterator<E>( ((DirectAccess<E>) smallSet).getRawData(), largeSet); } catch (ClassCastException e) { // resort to generic set intersection otherwise return new SetIntersectionIterator<E>(smallSet, largeSet); } }
@Override public void add(PropagationMatch1 conclusion, PropagationMatch1Watch inference) { watchedInferences_.add(conclusion, inference); }
CapacityBalancingEvictor(final double balance, final int balanceAfterNRepeatedQueries, final double loadFactor, final int initialCapacity) { super(initialCapacity, loadFactor); this.quantileEstimator_ = new QuantileEstimator(balance, initialCapacity); this.balanceAfterNRepeatedQueries_ = balanceAfterNRepeatedQueries; this.nRepeatedQueriesToBalance_ = balanceAfterNRepeatedQueries; this.stats = new Stats(); }
/** * Creates the node store with the provided initial capacity. * * @param capacity * The initial capacity. * @param keyProvider * The key provider for members of the nodes in this node store. */ public SynchronizedNodeStore(final int capacity, final ComparatorKeyProvider<? super T> keyProvider) { keyProvider_ = keyProvider; nodeLookup_ = new ArrayHashMap<Object, N>(capacity); allNodes_ = new ArrayHashSet<N>(capacity); }
@Override public void add(IndexedEquivalentClassesAxiomMatch1 conclusion, IndexedEquivalentClassesAxiomMatch1Watch inference) { watchedInferences_.add(conclusion, inference); }
@Override public void add(PropagationMatch1 conclusion, PropagationMatch1Watch inference) { watchedInferences_.add(conclusion, inference); }