Examples of nextClearBit()


Examples of java.util.BitSet.nextClearBit()

        BitSet in = new BitSet(n);
        double best = -1;
        int index = 0;
        for (int i = 0; i < n; i++) {
            int item = -1;
            for (int o = in.nextClearBit(0); o < n; o = in.nextClearBit(o + 1)) {
                if (item == -1 || ratio[o] > best) {
                    best = ratio[o];
                    item = o;
                }
            }
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

        BitSet in = new BitSet(n);
        double best = -1;
        int index = 0;
        for (int i = 0; i < n; i++) {
            int item = -1;
            for (int o = in.nextClearBit(0); o < n; o = in.nextClearBit(o + 1)) {
                if (item == -1 || ratio[o] > best) {
                    best = ratio[o];
                    item = o;
                }
            }
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

        int ub = vars[i].getUB();
        for (int k = vars[i].getLB(); k <= ub; k = vars[i].nextValue(k)) {
          valInMIS.set(k);
        }
      }
      for (int i = mis.nextClearBit(0); i < n; i = mis.nextClearBit(i + 1)) {
        int ub = vars[i].getUB();
        for (int k = vars[i].getLB(); k <= ub; k = vars[i].nextValue(k)) {
          if (!valInMIS.get(k)) {
            vars[i].removeValue(k, aCause);
          }
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

        int ub = vars[i].getUB();
        for (int k = vars[i].getLB(); k <= ub; k = vars[i].nextValue(k)) {
          valInMIS.set(k);
        }
      }
      for (int i = mis.nextClearBit(0); i < n; i = mis.nextClearBit(i + 1)) {
        int ub = vars[i].getUB();
        for (int k = vars[i].getLB(); k <= ub; k = vars[i].nextValue(k)) {
          if (!valInMIS.get(k)) {
            vars[i].removeValue(k, aCause);
          }
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

  public void filter(IntVar[] vars, UndirectedGraph graph, F heur, Propagator aCause) throws ContradictionException{
    assert  n == vars.length-1;
    BitSet mis = heur.getMIS();
    if(mis.cardinality()==vars[n].getUB()){
      ISet nei;
      for (int i = mis.nextClearBit(0); i>=0 && i < n; i = mis.nextClearBit(i + 1)) {
        int mate = -1;
        int last = 0;
        if(valToRem.length<vars[i].getDomainSize()){
          valToRem = new int[vars[i].getDomainSize()*2];
        }
 
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

  public void filter(IntVar[] vars, UndirectedGraph graph, F heur, Propagator aCause) throws ContradictionException{
    assert  n == vars.length-1;
    BitSet mis = heur.getMIS();
    if(mis.cardinality()==vars[n].getUB()){
      ISet nei;
      for (int i = mis.nextClearBit(0); i>=0 && i < n; i = mis.nextClearBit(i + 1)) {
        int mate = -1;
        int last = 0;
        if(valToRem.length<vars[i].getDomainSize()){
          valToRem = new int[vars[i].getDomainSize()*2];
        }
 
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

                boolean isKey = field.getAnnotation( TypeDeclaration.ATTR_KEY ) != null;
                fieldDef.setKey( isKey );

                fieldDef.setDeclIndex( field.getIndex() );
                if ( field.getIndex() < 0 ) {
                    int freePos = occupiedPositions.nextClearBit( 0 );
                    if ( freePos < maxDeclaredPos ) {
                        occupiedPositions.set( freePos );
                    } else {
                        freePos = maxDeclaredPos + 1;
                    }
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

    BitSet instances = runnableInstances.get(runnableName);
    if (instances == null) {
      instances = new BitSet();
      runnableInstances.put(runnableName, instances);
    }
    int instanceId = instances.nextClearBit(0);
    instances.set(instanceId);
    return instanceId;
  }

  private void removeInstanceId(String runnableName, int instanceId) {
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

        }

        int curr = 0;
        for (FieldDefinition fieldDef : fieldDefs) {
            if (fieldDef.getDeclIndex() < 0) {
                int freePos = occupiedPositions.nextClearBit(0);
                if (freePos < maxDeclaredPos) {
                    occupiedPositions.set(freePos);
                } else {
                    freePos = maxDeclaredPos + 1;
                }
View Full Code Here

Examples of java.util.BitSet.nextClearBit()

        BitSet b = new BitSet( l + 1 );
        b.or( key );
        int x = key.nextSetBit( 0 );
        if ( x == 0 ) {
            int y = b.nextClearBit( 0 );
            b.set( x, y, false );
            b.set(y);
        } else {
            b.set(0);
        }
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.