Examples of nextSetBit()


Examples of java.util.BitSet.nextSetBit()

        // context id.
        String[] contextLabels = new String[totalAssignments];
        for (Map.Entry<String, BitSet> entry : termContexts.entrySet()) {
            BitSet contextIds = entry.getValue();
            for (int contextId = contextIds.nextSetBit(0); contextId >= 0;
                     contextId = contextIds.nextSetBit(contextId+1))
                contextLabels[contextId] = entry.getKey();
        }
        return contextLabels;
    }
}
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

    public Set<TypedEdge<T>> getEdges(int vertex) {
        BitSet b = edges.get(vertex);
        if (b == null)
            return Collections.<TypedEdge<T>>emptySet();
        Set<TypedEdge<T>> s = new HashSet<TypedEdge<T>>();
        for (int i = b.nextSetBit(0); i >= 0; i = b.nextSetBit(i+1)) {
            @SuppressWarnings("unchecked")
            T type = (T)(TYPES.get(i));
            s.add(new SimpleTypedEdge<T>(type, vertex, rootVertex));
        }
        return s;
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

    public Set<TypedEdge<T>> getEdges(int vertex) {
        BitSet b = edges.get(vertex);
        if (b == null)
            return Collections.<TypedEdge<T>>emptySet();
        Set<TypedEdge<T>> s = new HashSet<TypedEdge<T>>();
        for (int i = b.nextSetBit(0); i >= 0; i = b.nextSetBit(i+1)) {
            @SuppressWarnings("unchecked")
            T type = (T)(TYPES.get(i));
            s.add(new SimpleTypedEdge<T>(type, vertex, rootVertex));
        }
        return s;
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

      }

      // Create an equivalent sparse bit set
      int[] members = new int[bs.cardinality()];
      for (int i = -1, k = 0; k < members.length; ++k) {
        members[k] = i = bs.nextSetBit(i + 1);
      }
      CharRanges sbs = CharRanges.withMembers(members);

      // Check all bits including past the min/max bit
      for (int i = 0; i < 0x5000; ++i) {
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

        }
        double totalLocalTime = 0.0;
        for (SplitDef split : splits) {
            BitSet locations = split.locations;
            totalLocalTime += split.localTime;
            for (int i = locations.nextSetBit(0); i >= 0; i = locations.nextSetBit(i + 1)) {
                pairs[i].time += split.localTime;
            }
        }
        Arrays.sort(pairs);
        double first = pairs[0].time;
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

        }
        double totalLocalTime = 0.0;
        for (SplitDef split : splits) {
            BitSet locations = split.locations;
            totalLocalTime += split.localTime;
            for (int i = locations.nextSetBit(0); i >= 0; i = locations.nextSetBit(i + 1)) {
                pairs[i].time += split.localTime;
            }
        }
        Arrays.sort(pairs);
        double first = pairs[0].time;
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

        assert locationNames.length >= 1;
        assert splits != null;
        double[] locationScores = new double[locationNames.length];
        for (SplitDef split : splits) {
            BitSet locations = split.locations;
            for (int i = locations.nextSetBit(0); i >= 0; i = locations.nextSetBit(i + 1)) {
                locationScores[i] += split.localTime;
            }
        }
        LocationAndTime[] pairs = new LocationAndTime[locationNames.length];
        for (int i = 0; i < pairs.length; i++) {
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

        assert locationNames.length >= 1;
        assert splits != null;
        double[] locationScores = new double[locationNames.length];
        for (SplitDef split : splits) {
            BitSet locations = split.locations;
            for (int i = locations.nextSetBit(0); i >= 0; i = locations.nextSetBit(i + 1)) {
                locationScores[i] += split.localTime;
            }
        }
        LocationAndTime[] pairs = new LocationAndTime[locationNames.length];
        for (int i = 0; i < pairs.length; i++) {
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

            int cardinality = localSlots.cardinality();
            if (cardinality == 0) {
                return getRandomSlot();
            }
            int nth = random.nextInt(cardinality);
            int current = localSlots.nextSetBit(0);
            for (int i = 0; i < nth; i++) {
                assert current >= 0;
                assert current < slots.length;
                current = localSlots.nextSetBit(current + 1);
            }
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

            int nth = random.nextInt(cardinality);
            int current = localSlots.nextSetBit(0);
            for (int i = 0; i < nth; i++) {
                assert current >= 0;
                assert current < slots.length;
                current = localSlots.nextSetBit(current + 1);
            }
            assert current >= 0;
            assert current < slots.length;
            return current;
        }
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.