85 cout <<
"Sparse vector:" << endl;
86 std::for_each(sv.
begin(), sv.
end(), [](
unsigned v) {
94 scanner.
bind(sv,
false);
109 bool id_max_seen(
false);
110 for (;it != it_end; ++it)
129 scanner.
find_eq(sv, v, bv_res);
147 cout <<
"Value = " << v <<
" is unique" << endl;
150 cout <<
"Value = " << v <<
" is colocated" << endl;
153 cout <<
"Value = " << v <<
" is not colocated" << endl;
156 catch(std::exception& ex)
158 std::cerr << ex.what() << std::endl;
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
Algorithms for bit ranges and intervals.
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)
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.
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
forward iterator class to traverse bit-vector as ranges
size_type end() const BMNOEXCEPT
Return interval end/right as bit-vector coordinate 011110 [left..right].
bool valid() const BMNOEXCEPT
Returns true if enumerator is valid (false if traversal is done)
size_type start() const BMNOEXCEPT
Return interval start/left as bit-vector coordinate 011110 [left..right].
algorithms for sparse_vector scan/search
void find_eq(const SV &sv, value_type value, bvector_type &bv_out)
find all sparse vector elements EQ to search value
void bind(const SV &sv, bool sorted)
bind sparse vector for all searches
allocator_pool_type & get_bvector_alloc_pool() BMNOEXCEPT
Return allocator pool for blocks (Can be used to improve performance of repeated searches with the sa...
succinct sparse vector with runtime compression using bit-slicing / transposition method
const_iterator end() const BMNOEXCEPT
Provide const iterator access to the end
friend back_insert_iterator
const_iterator begin() const BMNOEXCEPT
Provide const iterator access to container content
void optimize(bm::word_t *temp_block=0, typename bvector_type::optmode opt_mode=bvector_type::opt_compress, typename sparse_vector< Val, BV >::statistics *stat=0)
run memory optimization for all vector planes
bm::alloc_pool_guard< allocator_pool_type, bvector< Alloc > > mem_pool_guard
@ BM_GAP
GAP compression is ON.
bm::sparse_vector< unsigned, bvector_type > sparse_vector_u32
bm::interval_enumerator< bvector_type > interval_enumerator_type