Example how to use bvector<> in 64-bit mode
#include <iostream>
#include <assert.h>
#include "bm64.h"
using namespace std;
{
try
{
cout << "BitCount = " << count << endl;
cout <<
"Max possible ID = " <<
bm::id_max-1 << endl;
bool range_found = bv.find_range(first, last);
assert(range_found);
(void)range_found;
cout << "[" << first << ", " << last << "]" << endl;
auto full_count = bv_full.
count();
cout << "Full vector bitcount = " << full_count << endl;
bv &= bv_full;
{
cout << idx << ", ";
}
cout << endl;
}
catch(std::exception& ex)
{
std::cerr << ex.what() << std::endl;
return 1;
}
return 0;
}
pre-processor un-defines to avoid global space pollution (internal)
Constant iterator designed to enumerate "ON" bits.
bool valid() const BMNOEXCEPT
Checks if iterator is still valid.
Bitvector Bit-vector container with runtime compression of bits.
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.
bvector_size_type size_type
unsigned long long int id64_t