42 cout << sv.size() <<
": [ EMPTY ]" << endl;
45 cout << sv.size() <<
": [ ";
46 for (
unsigned i = 0; i < sv.size(); ++i)
48 unsigned v = sv.at(i);
49 bool is_null = sv.is_null(i);
87 unsigned arr[3] = {1,2,3};
141 bm::bvector<>::enumerator en = bv_non_null->
first();
143 for (; en.valid(); ++en)
146 unsigned v = sv1[idx];
147 std::cout <<
"[" << idx <<
"] = " << v <<
", ";
158 std::vector<unsigned> v1(sv1.
size());
162 for (
unsigned i = 0; i < v1.size(); ++i)
164 cout << v1[i] <<
",";
169 catch(std::exception& ex)
171 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.
const bvector_type * get_null_bvector() const BMNOEXCEPT
Get bit-vector of assigned values or NULL (if not constructed that way)
enumerator first() const
Returns enumerator pointing on the first non-zero bit.
sparse vector with runtime compression using bit transposition method
void set_null(size_type idx)
set specified element to unassigned value (NULL)
void push_back(value_type v)
push value back into vector
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
void resize(size_type sz)
resize vector
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 clear(size_type idx, bool set_null=false)
clear specified element with bounds checking and automatic resize
@ use_null
support "non-assigned" or "NULL" logic
static void print_svector(const bm::sparse_vector< unsigned, bm::bvector<> > &sv)