Examples of nextSetBit()


Examples of java.util.BitSet.nextSetBit()

        BitSet activeLayers = new BitSet(nbC);
        activeLayers.set(1, nbC - 1, true);
        for (int i = 0; i < nbAd; i++) {
            allDiffLayers[i] = new BitSet(nbS);
            int k = rand.nextInt(activeLayers.cardinality());
            int v = activeLayers.nextSetBit(0);
            while (k > 0) {
                v = activeLayers.nextSetBit(v + 1);
                k--;
            }
            allDiffLayers[i].or(layers[v]);
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

        for (int i = 0; i < nbAd; i++) {
            allDiffLayers[i] = new BitSet(nbS);
            int k = rand.nextInt(activeLayers.cardinality());
            int v = activeLayers.nextSetBit(0);
            while (k > 0) {
                v = activeLayers.nextSetBit(v + 1);
                k--;
            }
            allDiffLayers[i].or(layers[v]);
            activeLayers.set(v, false);
        }
View Full Code Here

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

Examples of javolution.util.FastBitSet.nextSetBit()

            newKeysArray[keyPos] = null;
          }

          FastBitSet bitset = groupingSetsBitSet.get(groupingSetPos);
          // Some keys need to be left to null corresponding to that grouping set.
          for (int keyPos = bitset.nextSetBit(0); keyPos >= 0;
            keyPos = bitset.nextSetBit(keyPos+1)) {
            newKeysArray[keyPos] = cloneNewKeysArray[keyPos];
          }

          newKeysArray[groupingSetsPosition] = newKeysGroupingSets.get(groupingSetPos);
View Full Code Here

Examples of org.apache.lucene.util.BitSet.nextSetBit()

    private int findRootDocumentIfNested(SearchContext context, LeafReaderContext subReaderContext, int subDocId) throws IOException {
        if (context.mapperService().hasNested()) {
            BitDocIdSet nonNested = context.bitsetFilterCache().getBitDocIdSetFilter(NonNestedDocsFilter.INSTANCE).getDocIdSet(subReaderContext);
            BitSet bits = nonNested.bits();
            if (!bits.get(subDocId)) {
                return bits.nextSetBit(subDocId);
            }
        }
        return -1;
    }
View Full Code Here

Examples of org.apache.lucene.util.FixedBitSet.nextSetBit()

    final DocComparator childComparator = getChildComparator(reader);
    final DocComparator comparator = new DocComparator() {

      @Override
      public int compare(int docID1, int docID2) {
        final int parent1 = parentBits.nextSetBit(docID1);
        final int parent2 = parentBits.nextSetBit(docID2);
        if (parent1 == parent2) { // both are in the same block
          if (docID1 == parent1 || docID2 == parent2) {
            // keep parents at the end of blocks
            return docID1 - docID2;
View Full Code Here

Examples of org.apache.lucene.util.FixedBitSet.nextSetBit()

    final DocComparator comparator = new DocComparator() {

      @Override
      public int compare(int docID1, int docID2) {
        final int parent1 = parentBits.nextSetBit(docID1);
        final int parent2 = parentBits.nextSetBit(docID2);
        if (parent1 == parent2) { // both are in the same block
          if (docID1 == parent1 || docID2 == parent2) {
            // keep parents at the end of blocks
            return docID1 - docID2;
          } else {
View Full Code Here

Examples of org.apache.lucene.util.OpenBitSet.nextSetBit()

                return adjustedDoc;
              }

              @Override
              public int nextDoc() throws IOException {
                pos = bs.nextSetBit(pos+1);
                return adjustedDoc = (pos>=0 && pos<max) ? pos-base : NO_MORE_DOCS;
              }

              @Override
              public int advance(int target) throws IOException {
View Full Code Here

Examples of org.apache.lucene.util.OpenBitSet.nextSetBit()

              }

              @Override
              public int advance(int target) throws IOException {
                if (target==NO_MORE_DOCS) return adjustedDoc=NO_MORE_DOCS;
                pos = bs.nextSetBit(target+base);
                return adjustedDoc = (pos>=0 && pos<max) ? pos-base : NO_MORE_DOCS;
              }
            };
          }
View Full Code Here

Examples of org.drools.core.util.bitmask.OpenBitSet.nextSetBit()

                throw new IllegalStateException("Node exists, that is not part of a clique. " + varNode.toString());
            }
            int bestWeight = -1;
            int clique = -1;
            // finds the smallest node, that contains all the parents
            for ( int j = cliques.nextSetBit(0); j >= 0; j = cliques.nextSetBit( j+ 1 ) ) {
                JunctionTreeClique jtNode = jtNodes[j];

                // if the node has parents, we find the small clique it's in.
                // If it has parents then is jtNode a supserset of parents, visa-vis is parents a subset of jtNode
                if ( (count == 0 || OpenBitSet.andNotCount(parents, jtNode.getBitSet()) == 0 ) && ( clique == -1 || jtNode.getBitSet().cardinality() < bestWeight ) ) {
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.