public class BitSetPlus extends BitSet
BitSet.| Constructor and Description |
|---|
BitSetPlus() |
BitSetPlus(int bitCount) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(BitSet bitSet)
Returns true if every bit in this set is also set in
bitSet. |
BigInteger |
countSupersetDiff(List<BitSetPlus> minusBitSets)
Returns the number of bitsets which are supersets of this BitSetPlus
but which are not supersets of any of the sets in
minusBitSets. |
static BigInteger |
countSupersetIntersection_old(int bitCount,
BitSetPlus[] bitSets)
Returns the number of sets which are supersets of at least one of the
members of
bitSets. |
static BigInteger |
countSupersetIntersection(int bitCount,
BitSetPlus[] bitSets)
Returns the number of sets which are supersets of every member of
bitSets. |
int |
getBitCount() |
BigInteger |
supersetCardinality()
Returns the number of bitsets which are supersets of
bitSet. |
and, andNot, cardinality, clear, clear, clear, clone, equals, flip, flip, get, get, hashCode, intersects, isEmpty, length, nextClearBit, nextSetBit, or, previousClearBit, previousSetBit, set, set, set, set, size, toByteArray, toLongArray, toString, valueOf, valueOf, valueOf, valueOf, xorpublic int getBitCount()
public BigInteger supersetCardinality()
bitSet.
For example, supersetCardinality(4, {0, 1, 1, 0}) is 4,
because the supersets are {{0, 1, 1, 0}, {0, 1, 1, 1}, {1, 1, 1, 0},
{1, 1, 1, 1}}.
The formula is 2 ^ number of zero bits.
bitSet
(including the bitset itself and the full set).public BigInteger countSupersetDiff(List<BitSetPlus> minusBitSets)
minusBitSets.
This method takes time and space exponential in the cardinality of
minusBitSets.
minusBitSets - List of bit sets to subtractpublic boolean contains(BitSet bitSet)
bitSet.public static BigInteger countSupersetIntersection_old(int bitCount, BitSetPlus[] bitSets)
bitSets.
Example 1. Consider bitset0 = {0, 1, 1, 0}, bitset1 = {1, 0, 1, 1}. The supersets look like {0 or 1, 0 or 1, 1, 0 or 1}.
bitCount - Number of bits in each bitsetbitSets - List of bitsetspublic static BigInteger countSupersetIntersection(int bitCount, BitSetPlus[] bitSets)
bitSets.
Example 1. Consider bitset0 = {0, 1, 1, 0}, bitset1 = {1, 0, 1, 1}. The supersets look like {0 or 1, 0 or 1, 1, 0 or 1}.
bitCount - Number of bits in each bitsetbitSets - List of bitsetsCopyright © 2006–2016 Julian Hyde. All rights reserved.