Example of bit-vector import from an external bit-stream
- See also
- bm::bvector::bulk_insert_iterator
#include <stdlib.h>
#include <assert.h>
#include <iostream>
using namespace std;
{
try
{
unsigned int arr[2058] = {0, };
arr[0] = 1 << 16;
arr[2047] = 1u << 31;
arr[2048] = 1u << 7;
cout << "Imported " << cnt << " bits." << endl;
assert(cnt == 3);
assert(bv.
test(65536 + 7));
}
catch(std::exception& ex)
{
std::cerr << ex.what() << std::endl;
return 1;
}
return 0;
}
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
Import of bvector<> from native type bit-arrays.
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)
void bit_import_u32(BV &bv, const unsigned int *BMRESTRICT bit_arr, typename BV::size_type bit_arr_size, bool optimize)
Import native stream of bits (represented as 32-bit unsigned ints)