49 cout <<
"1. bitcount: " << bv.
count() << endl;
59 cout <<
"2. bitcount: " << bv.
count() << endl;
83 cout <<
"3. bitcount: " << bv.
count() << endl;
91 cout <<
"4. bitcount: " << bv.
count() << endl;
98 cout <<
"5. bitcount: " << bv.
count() << endl;
104 cout <<
"6. bitcount: " << bv.
count() << endl;
107 assert(!bv.
test(100));
110 catch(std::exception& ex)
112 std::cerr << ex.what() << std::endl;
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
pre-processor un-defines to avoid global space pollution (internal)
Bitvector Bit-vector container with runtime compression of bits.
bool test(size_type n) const BMNOEXCEPT
returns true if bit n is set and false is bit n is 0.
size_type count() const BMNOEXCEPT
population count (count of ON bits)
bvector< Alloc > & set(size_type n, bool val=true)
Sets bit n if val is true, clears bit n if val is false.
size_type get_next(size_type prev) const BMNOEXCEPT
Finds the number of the next bit ON.
void swap(bvector< Alloc > &bvect) BMNOEXCEPT
Exchanges content of bv and this bvector.
size_type get_first() const BMNOEXCEPT
find first 1 bit in vector. Function may return 0 and this requires an extra check if bit 0 is actual...
void clear(const size_type *ids, size_type ids_size, bm::sort_order so=bm::BM_UNKNOWN)
clear list of bits in this bitset