public static SparseIntSet pair(int i, int j) { if (i == j) { return SparseIntSet.singleton(i); } if (j > i) { return new SparseIntSet(new int[] { i, j }); } else { return new SparseIntSet(new int[] { j, i }); } }
@Override public SparseIntSet getTargets(int i) { if (i == 0) { return SparseIntSet.add(zeroSet,dest); } else { return null; } }
protected SparseIntSet(SparseIntSet S) { cloneState(S); }
/** * Compute the asymmetric difference of two sets, a \ b. */ public static SparseIntSet diff(SparseIntSet A, SparseIntSet B) { return new SparseIntSet(diffInternal(A, B)); }
@Override public IntSet getTargets(int d1) { return 0 == d1 ? result : SparseIntSet.singleton(d1); }
/** */ public SparseIntSet makeSparseCopy() { return (S == null) ? new SparseIntSet() : new SparseIntSet(S); }
int ss1 = smallStore[1].get(x); if (ss1 == EMPTY_CODE) { return SparseIntSet.singleton(ss0); } else { return SparseIntSet.pair(ss0, ss1); return SparseIntSet.singleton(ss0); } else { int ss1 = smallStore[1].get(x); if (ss1 == EMPTY_CODE) { return SparseIntSet.singleton(ss0); } else { MutableSparseIntSet result = MutableSparseIntSet.createMutableSparseIntSet(ssLength);
@Override public boolean containsAny(IntSet set) { if (set instanceof SparseIntSet) { return containsAny((SparseIntSet) set); } else if (set instanceof BimodalMutableIntSet) { return set.containsAny(this); } else { for (int i = 0; i < size; i++) { if (set.contains(elements[i])) { return true; } } return false; } }
/** * Compute the asymmetric difference of two sets, a \ b. */ public static IntSet diff(IntSet A, IntSet B, MutableIntSetFactory<?> factory) { if (factory == null) { throw new IllegalArgumentException("null factory"); } if (A == null) { throw new IllegalArgumentException("null A"); } if (B == null) { throw new IllegalArgumentException("null B"); } if (A instanceof SparseIntSet && B instanceof SparseIntSet) { return SparseIntSet.diff((SparseIntSet) A, (SparseIntSet) B); } else if (A instanceof SemiSparseMutableIntSet && B instanceof SemiSparseMutableIntSet) { IntSet d = SemiSparseMutableIntSet.diff((SemiSparseMutableIntSet) A, (SemiSparseMutableIntSet) B); return d; } else { return defaultSlowDiff(A, B, factory); } }
@Override public SparseIntSet getSources(int i) { return SparseIntSet.singleton(i); }
@Override public SparseIntSet getTargets(int d1) { // kill even the reachability predicate 0. return new SparseIntSet(); } @Override
int ss1 = smallStore[1].get(x); if (ss1 == EMPTY_CODE) { return SparseIntSet.singleton(ss0); } else { return SparseIntSet.pair(ss0, ss1); return SparseIntSet.singleton(ss0); } else { int ss1 = smallStore[1].get(x); if (ss1 == EMPTY_CODE) { return SparseIntSet.singleton(ss0); } else { MutableSparseIntSet result = MutableSparseIntSet.createMutableSparseIntSet(ssLength);
/** * Compute the asymmetric difference of two sets, a \ b. */ public static SparseIntSet diff(SparseIntSet A, SparseIntSet B) { return new SparseIntSet(diffInternal(A, B)); }
@Override public boolean containsAny(IntSet set) { if (set instanceof SparseIntSet) { return containsAny((SparseIntSet) set); } else if (set instanceof BimodalMutableIntSet) { return set.containsAny(this); } else { for (int i = 0; i < size; i++) { if (set.contains(elements[i])) { return true; } } return false; } }
/** * Compute the asymmetric difference of two sets, a \ b. */ public static IntSet diff(IntSet A, IntSet B, MutableIntSetFactory<?> factory) { if (factory == null) { throw new IllegalArgumentException("null factory"); } if (A == null) { throw new IllegalArgumentException("null A"); } if (B == null) { throw new IllegalArgumentException("null B"); } if (A instanceof SparseIntSet && B instanceof SparseIntSet) { return SparseIntSet.diff((SparseIntSet) A, (SparseIntSet) B); } else if (A instanceof SemiSparseMutableIntSet && B instanceof SemiSparseMutableIntSet) { IntSet d = SemiSparseMutableIntSet.diff((SemiSparseMutableIntSet) A, (SemiSparseMutableIntSet) B); return d; } else { return defaultSlowDiff(A, B, factory); } }
public static SparseIntSet pair(int i, int j) { if (i == j) { return SparseIntSet.singleton(i); } if (j > i) { return new SparseIntSet(new int[] { i, j }); } else { return new SparseIntSet(new int[] { j, i }); } }
@Override public SparseIntSet getSources(int i) { return SparseIntSet.singleton(i); }
/** */ public SparseIntSet makeSparseCopy() { return (S == null) ? new SparseIntSet() : new SparseIntSet(S); }