Examples of IntBitSet


Examples of bak.pcj.set.IntBitSet

     */
    public IntBitSetBenchmark() {
        super(
            new IntSetFactory() {
                public IntSet create(int[] elements) {
                    IntSet s = new IntBitSet();
                    for (int i = 0; i < elements.length; i++)
                        s.add(elements[i]);
                    return s;
                }
            }
        );
    }
View Full Code Here

Examples of com.bpodgursky.set_query_lib.IntBitSet

  public DataNode(int[] id, DataNode[] children, long size) {
    super(id, children);

    this.cumulativeBelow = size;
    this.allBelow = new IntBitSet(id);
  }
View Full Code Here

Examples of com.bpodgursky.set_query_lib.IntBitSet

  private long count;

  public SupersetNode(int[] id, SupersetNode[] children, long count) {
    super(id, children);

    this.allBelow = new IntBitSet(id);
    this.count = count;
  }
View Full Code Here

Examples of com.bpodgursky.set_query_lib.IntBitSet

  }

  public List<Set<K>> supersetQuery(Set<K> query, int maxMatches) {

    // Run subset query on all children of the root.
    IntBitSet supersetQuery = new IntBitSet(getIndices(query));

    List<Collection<Integer>> matches = new LinkedList<Collection<Integer>>();
    matchSuperset(supersetQuery, getRoot(), matches, new Stack<Integer>(), maxMatches);

    List<Set<K>> matchesReversed = new ArrayList<Set<K>>(matches.size());
View Full Code Here

Examples of kodkod.util.ints.IntBitSet

   * of one of the ArrayTrace constructors.
   * @return trace
   */
  private int[][] format(int[][] trace) {
    final int length = trace.length;
    final IntSet resolvents = new IntBitSet(length);
    final int offset = numberOfVariables() + 1;
    for(int i = 0; i < length; i++) {
      int[] clause = trace[i];
      if (clause!=null && clause[0]>=offset) {
        clause[0] -= offset;
        resolvents.add(i);
      }
    }
       
    final int axioms = length - resolvents.size();
    if (resolvents.min()<axioms) {
      final int[] position = new int[length];
      for(int i = 0, axiomIndex = 0, resolventIndex = axioms; i < length; i++) {
        if (resolvents.contains(i)) {
          position[i] = resolventIndex++;
          int[] resolvent = trace[i];
          for(int j = 0, resLength = resolvent.length; j < resLength; j++) {
            resolvent[j] = position[resolvent[j]];
          }
        } else {
          position[i] = axiomIndex++;
        }
      }

      for(IntIterator itr = resolvents.iterator(length, 0); itr.hasNext(); ) {
        int i = itr.next();
        int pos = position[i];
        if (i==pos) continue; // correctly positioned, do nothing
        int[] resolvent = trace[i];
        System.arraycopy(trace, i+1, trace, i, pos-i);
View Full Code Here

Examples of kodkod.util.ints.IntBitSet

    hits.indices().retainAll(relevantVars);
   
    if (hits.get(hits.indices().min())==null) { // first call, initialize the hits
      for(IntIterator varItr = relevantVars.iterator(); varItr.hasNext(); ) {
        final int var = varItr.next();
        final IntSet varReachable = new IntBitSet(var+1);
        varReachable.add(var);
        hits.put(var, varReachable);
      }
      for(Iterator<Clause> clauseItr = trace.reverseIterator(trace.axioms()); clauseItr.hasNext();) {
        final Clause clause = clauseItr.next();
        final int maxVar = clause.maxVariable();
View Full Code Here

Examples of kodkod.util.ints.IntBitSet

   
    // trim the trace so that it contains all axioms but only those resolvents that are reachable from the conflict
    this.trace = compress(trace, axioms, reachable, core);
   
    // we haven't computed any resolvent literals yet ...
    this.resolved = new IntBitSet(this.trace.length-axioms);
  }
View Full Code Here

Examples of kodkod.util.ints.IntBitSet

   
    // trim the trace so that it contains all axioms but only those resolvents that are reachable from the conflict
    this.trace = compress(partial, axioms, reachable, core);
   
    // we haven't computed any resolvent literals yet ...
    this.resolved = new IntBitSet(this.trace.length-axioms);
  }
View Full Code Here

Examples of kodkod.util.ints.IntBitSet

   * @return indices of all clauses in the given trace that are
   * reachable from the conflict clause through the resolvents in
   * trace[roots..trace.length-1]
   */
  private static IntSet reachable(int[][] trace, int roots) {
    final IntSet reachable = new IntBitSet(trace.length);
    reachable.add(trace.length-1);
    for(int i = trace.length-1; i >= roots; i--) {
      if (reachable.contains(i)) {
        int[] resolvent = trace[i];
        for(int j = 0; j < resolvent.length; j++) {
          reachable.add(resolvent[j]);
        }
      }
    }
    return reachable;
  }
View Full Code Here

Examples of kodkod.util.ints.IntBitSet

   * reachable between 0, inclusive, and axioms, exclusive.
   * @return a set that contains the elements from the given
   * reachable between 0, inclusive, and axioms, exclusive.
   */
  private static IntSet core(IntSet reachable, int axioms) {
    final IntSet core = new IntBitSet(axioms);
    for(IntIterator itr = reachable.iterator(0, axioms-1); itr.hasNext(); ) {
      core.add(itr.next());
    }
    return Ints.unmodifiableIntSet(core);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.