Package java.util

Examples of java.util.BitSet.nextSetBit()


    int timeIndex = 0;
    while(timeIndex<n*2){
      Event event = events[timeIndex++];
      switch(event.type) {
        case(START):
          for(int i=tprune.nextSetBit(0);i>=0;i=tprune.nextSetBit(i+1)){
            g.addEdge(i,event.index);
          }
          tprune.set(event.index);
          break;
        case(END):
View Full Code Here


        List<BoolVar> lbvars = new ArrayList<BoolVar>();
        for (int i = 0; i < alldiffLayers.length; i++) {
            BitSet disjoint = alldiffLayers[i];
            IntVar[] _vars = new IntVar[disjoint.cardinality()];
            int[] _durs = new int[disjoint.cardinality()];
            for (int k = 0, j = disjoint.nextSetBit(0); j >= 0; j = disjoint.nextSetBit(j + 1), k++) {
                _vars[k] = vars[j];
                _durs[k] = 1;
            }
            for (int l = 0; l < _vars.length - 1; l++) {
                for (int m = l + 1; m < _vars.length; m++) {
View Full Code Here

        List<BoolVar> lbvars = new ArrayList<BoolVar>();
        for (int i = 0; i < alldiffLayers.length; i++) {
            BitSet disjoint = alldiffLayers[i];
            IntVar[] _vars = new IntVar[disjoint.cardinality()];
            int[] _durs = new int[disjoint.cardinality()];
            for (int k = 0, j = disjoint.nextSetBit(0); j >= 0; j = disjoint.nextSetBit(j + 1), k++) {
                _vars[k] = vars[j];
                _durs[k] = 1;
            }
            for (int l = 0; l < _vars.length - 1; l++) {
                for (int m = l + 1; m < _vars.length; m++) {
View Full Code Here

    int n = vars.length-1;
    BitSet mis = heur.getMIS();
    if(mis.cardinality()==vars[n].getUB()){
      if(valInMIS == null) valInMIS = new BitSet();
      valInMIS.clear();
      for (int i = mis.nextSetBit(0); i >= 0; i = mis.nextSetBit(i + 1)) {
        int ub = vars[i].getUB();
        for (int k = vars[i].getLB(); k <= ub; k = vars[i].nextValue(k)) {
          valInMIS.set(k);
        }
      }
View Full Code Here

    int n = vars.length-1;
    BitSet mis = heur.getMIS();
    if(mis.cardinality()==vars[n].getUB()){
      if(valInMIS == null) valInMIS = new BitSet();
      valInMIS.clear();
      for (int i = mis.nextSetBit(0); i >= 0; i = mis.nextSetBit(i + 1)) {
        int ub = vars[i].getUB();
        for (int k = vars[i].getLB(); k <= ub; k = vars[i].nextValue(k)) {
          valInMIS.set(k);
        }
      }
View Full Code Here

    int n = vars.length-1;
    BitSet mis = heur.getMIS();
    if(mis.cardinality()==vars[n].getUB()){
      IntVar[] vs = new IntVar[mis.cardinality()];
      int idx = 0;
      for(int x=mis.nextSetBit(0);x>=0;x=mis.nextSetBit(x+1)){
        vs[idx++] = vars[x];
      }
      if(filter==null)filter=new AlgoAllDiffBC(aCause);
      filter.reset(vs);
      filter.filter();
View Full Code Here

    int n = vars.length-1;
    BitSet mis = heur.getMIS();
    if(mis.cardinality()==vars[n].getUB()){
      IntVar[] vs = new IntVar[mis.cardinality()];
      int idx = 0;
      for(int x=mis.nextSetBit(0);x>=0;x=mis.nextSetBit(x+1)){
        vs[idx++] = vars[x];
      }
      if(filter==null)filter=new AlgoAllDiffBC(aCause);
      filter.reset(vs);
      filter.filter();
View Full Code Here

    private boolean isRegModified(int reg, int firstPC, int lastPC) {
        if (reg < 0) {
            return false;
        }
        BitSet b = getModifiedBitSet(reg);
        int modified = b.nextSetBit(firstPC);
        return (modified >= firstPC && modified <= lastPC);
    }

    static class Jump {
        final int from, to;
View Full Code Here

   * @param e
   *      the entity to remove components from
   */
  private void removeComponents(Entity e) {
    BitSet componentBits = e.getComponentBits();
    for (int i = componentBits.nextSetBit(0); i >= 0; i = componentBits.nextSetBit(i+1)) {
      switch (typeFactory.getTaxonomy(i)) {
        case BASIC:
          componentsByType.get(i).set(e.getId(), null);
          break;
        case POOLED:
View Full Code Here

   * @param e
   *      the entity to remove components from
   */
  private void removeComponents(Entity e) {
    BitSet componentBits = e.getComponentBits();
    for (int i = componentBits.nextSetBit(0); i >= 0; i = componentBits.nextSetBit(i+1)) {
      switch (typeFactory.getTaxonomy(i)) {
        case BASIC:
          componentsByType.get(i).set(e.getId(), null);
          break;
        case POOLED:
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.