Examples of cardinality()


Examples of java.util.BitSet.cardinality()

                size -= edges;
                removed += edges;
            }
            b = outEdges.remove(v);
            if (b != null) {
                int edges = b.cardinality();
                size -= edges;
                removed += edges;
            }
            assert removed > 0 :
                "connected removed an edge that wasn't listed elsewhere";
View Full Code Here

Examples of java.util.BitSet.cardinality()

        // If there was an edge of that type, remove it and update the
        // "connected" set as necessary
        if (types.get(index)) {
            types.set(index, false);
            // If this was the last edge to that vertex, remove this BitMap
            if (types.cardinality() == 0) {
                edges.remove(i);
                size--;
                // Check whether the other set has this edge, and if not, remove
                // it from the cache of connected vertices
                TIntObjectHashMap<BitSet> other = (edges == inEdges)
View Full Code Here

Examples of java.util.BitSet.cardinality()

        @Override public int size() {
            BitSet in = inEdges.get(otherVertex);
            BitSet out = outEdges.get(otherVertex);
            return ((in == null) ? 0 : in.cardinality())
                + ((out == null) ? 0 : out.cardinality());
        }
    }

    /**
     * An iterator over the edges in this set that constructs {@link
View Full Code Here

Examples of java.util.BitSet.cardinality()

                && CompactSparseTypedEdgeSet.this.remove(e);
        }

        @Override public int size() {
            BitSet b = edges.get(otherVertex);
            return (b == null) ? 0 : b.cardinality();
        }
    }

    /**
     * An iterator over the edges in this set that constructs {@link
View Full Code Here

Examples of java.util.BitSet.cardinality()

      for (int i = 0x1000; --i >= 0;) {
        bs.set(0x1000 + rnd.nextInt(0x3000));
      }

      // 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);
View Full Code Here

Examples of java.util.BitSet.cardinality()

    }

    public void flush() {
        BitSet bulk = tryFlush();
        if (!bulk.isEmpty()) {
            throw new EsHadoopException(String.format("Could not write all entries [%s/%s] (maybe ES was overloaded?). Bailing out...", bulk.cardinality(), bulk.size()));
        }
    }

    @Override
    public void close() {
View Full Code Here

Examples of java.util.BitSet.cardinality()

//    }
   
    bs.set("afafadsfasdaaaaaaaaaaaaaa".hashCode(), true);
   
   
    int count = bs.cardinality() + as.cardinality();
    System.out.println(count);
  }
 
  public static void main1(String[] args) throws Exception
  {
View Full Code Here

Examples of java.util.BitSet.cardinality()

        // put every 10th id into the queue
        for (int i = 0; i < size; i += 10) {
            queue.push(i);
        }

        while (bitSet.cardinality() < size && queue.size() > 0) {
            if (bitSet.cardinality() % 10000 == 0) {
                System.out.println("Crawled nodes: " + bitSet.cardinality());
            }
            int nodeId = queue.poll();
            if (!bitSet.get(nodeId)) {
View Full Code Here

Examples of java.util.BitSet.cardinality()

        for (int i = 0; i < size; i += 10) {
            queue.push(i);
        }

        while (bitSet.cardinality() < size && queue.size() > 0) {
            if (bitSet.cardinality() % 10000 == 0) {
                System.out.println("Crawled nodes: " + bitSet.cardinality());
            }
            int nodeId = queue.poll();
            if (!bitSet.get(nodeId)) {
                // ok we saw this node
View Full Code Here

Examples of java.util.BitSet.cardinality()

            queue.push(i);
        }

        while (bitSet.cardinality() < size && queue.size() > 0) {
            if (bitSet.cardinality() % 10000 == 0) {
                System.out.println("Crawled nodes: " + bitSet.cardinality());
            }
            int nodeId = queue.poll();
            if (!bitSet.get(nodeId)) {
                // ok we saw this node
                bitSet.set(nodeId, true);
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.