52 cout << sv.
size() <<
": [ EMPTY ]" << endl;
55 cout << sv.
size() <<
": [ ";
56 for (
unsigned i = 0; i < sv.
size(); ++i)
58 unsigned v = sv.
at(i);
77 cout <<
"( count = " << bv.
count() <<
")" <<
": [";
79 for (; en.
valid(); ++en)
103 sv_transform.
set(2, 25);
104 sv_transform.
set(3, 35);
105 sv_transform.
set(7, 75);
106 sv_transform.
set(1000, 2000);
107 sv_transform.
set(256, 2001);
118 func.
run(bv_in, sv_transform, bv_out);
120 std::cout <<
"re-mapped vector:" << endl;
129 bool found = func.
remap(1, sv_transform, to);
131 std::cout << from <<
" not mapped" << std::endl;
133 std::cout << from <<
" mapped to " << to << std::endl;
141 sv_transform2.
set(2, 25);
142 sv_transform2.
set(3, 35);
143 sv_transform2.
set(7, 75);
144 sv_transform2.
set(1000, 2000);
145 sv_transform2.
set(256, 2001);
147 found = func.
remap(1, sv_transform2, to);
149 std::cout << from <<
" not mapped" << std::endl;
151 std::cout << from <<
" mapped to " << to << std::endl;
157 func.
run(bv_in, sv_transform2, bv_out);
159 std::cout <<
"re-mapped vector2:" << endl;
163 catch(std::exception& ex)
165 std::cerr << ex.what() << std::endl;
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
Sparse constainer sparse_vector<> for integer types using bit-transposition transform.
Algorithms for bm::sparse_vector.
pre-processor un-defines to avoid global space pollution (internal)
bool is_null(size_type idx) const BMNOEXCEPT
test if specified element is NULL
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)
enumerator first() const
Returns enumerator pointing on the first non-zero bit.
succinct sparse vector with runtime compression using bit-slicing / transposition method
value_type at(size_type idx) const
access specified element with bounds checking
size_type size() const BMNOEXCEPT
return size of the vector
void set(size_type idx, value_type v)
set specified element with bounds checking and automatic resize
@ use_null
support "non-assigned" or "NULL" logic
bm::sparse_vector< bm::id_t, bm::bvector<> > sparse_vector_u32
void print_bvector(const bm::bvector<> &bv)
static void print_svector(const sparse_vector_u32 &sv)