46 unsigned arr[3] = {1,2,3};
55 cout <<
"sv1.size() = " << sv1.
size() <<
": ";
56 for (i = 0; i < sv1.
size(); ++i)
58 cout << sv1.
at(i) <<
",";
64 for (i = 65536; i < 65536+10; ++i)
68 cout <<
"sv2.size() = " << sv2.
size() << endl;
70 cout <<
"Perform sparse_vector<>::join()" << endl;
76 cout <<
"Now sv1.size() = " << sv1.
size() << endl;
79 std::vector<unsigned> v1(16);
80 sv1.
decode(&v1[0], 65530, 16);
81 for (i = 0; i < 16; ++i)
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
#define BM_DECLARE_TEMP_BLOCK(x)
Sparse constainer sparse_vector<> for integer types using bit-transposition transform.
pre-processor un-defines to avoid global space pollution (internal)
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
sparse_vector< Val, BV > & join(const sparse_vector< Val, BV > &sv)
join all with another sparse vector using OR operation
size_type decode(value_type *arr, size_type idx_from, size_type dec_size, bool zero_mem=true) const
Bulk export list of elements to a C-style array.
void import(const value_type *arr, size_type arr_size, size_type offset=0, bool set_not_null=true)
Import list of elements from a C-style array.
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