|
| Bitset () |
| An empty set, with minimal preallocated storage.
|
|
| Bitset (Int n, const bool full=false) |
| An empty set with preallocated storage for elements 0..n-1. More...
|
|
| Bitset (const mpz_t &b) |
| Copy the value from a third party.
|
|
| Bitset (mpz_t &&b) noexcept |
|
| Bitset (const GenericSet< Bitset > &s) |
| Copy of a disguised Bitset object.
|
|
template<typename TSet > |
| Bitset (const GenericSet< TSet, Int > &s) |
| Copy of an abstract set of integers.
|
|
template<typename TSet , typename E2 , typename Comparator2 , typename = std::enable_if_t<std::is_convertible<E2, Int>::value>> |
| Bitset (const GenericSet< TSet, E2, Comparator2 > &s) |
| Copy of an abstract set with element conversion.
|
|
| Bitset (gmp_randstate_t rnd, Int bits) |
| Fill with a prescribed number of random bits.
|
|
Bitset & | operator= (const GenericSet< Bitset > &s) |
| Assign elements from a disguised Bitset object.
|
|
void | reserve (Int n) |
| Reserve storage for n elements.
|
|
void | resize (Int n) |
| Synonym for reserve, for compatibility with other set classes.
|
|
void | clear () |
| Make the set empty.
|
|
template<typename Set2 > |
std::enable_if_t<!std::is_same< Set2, Bitset >::value, Bitset & > | operator= (const GenericSet< Set2, Int, element_comparator > &s) |
| Assign elements from an abstract set of integers.
|
|
Int | size () const noexcept |
|
Bitset & | operator+= (Int i) |
|
Bitset & | operator-= (Int i) |
|
Bitset & | operator*= (Int i) |
| intersection
|
|
bool | operator== (const GenericSet< Set2, E, Comparator > &s) const |
| comparison
|
|
bool | operator< (const GenericSet< Set2, E, Comparator > &s) const |
| lexicographical comparison
|
|
Container class for dense sets of integers.
A special class optimized for representation of a constrained range of non-negative integer numbers. Its implementation is based on the GMP (mpz_t), see http://www.swox.com/gmp/ You should consider to use it instead of the more general Set<Int> if all these criteria hold:
- the element range stays constant during the lifetime of the set
- the element range is small (magnitude of tens), or the fill grade (number of elements divided through the element upper bound) is expected to be rather high (>= 0.5)
- the number of random access operations (testing/addition/removal of single elements) prevails significantly over the number of sequential visits via iterators
Note that unlike std::bitset
, the element range is not hard encoded in the Bitset object, but can be dynamically changed any time.