51 cout << sv.size() <<
": [ EMPTY ]" << endl;
54 cout << sv.size() <<
": [ ";
55 for (
unsigned i = 0; i < sv.size(); ++i)
57 unsigned v = sv.at(i);
58 bool is_null = sv.is_null(i);
96 unsigned arr[3] = {1,2,3};
176 for (; en.
valid(); ++en)
179 unsigned v = sv1[idx];
180 std::cout <<
"[" << idx <<
"] = " << v <<
", ";
191 std::vector<unsigned> v1(sv1.
size());
195 for (
unsigned i = 0; i < v1.size(); ++i)
197 cout << v1[i] <<
",";
202 catch(std::exception& ex)
204 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.
pre-processor un-defines to avoid global space pollution (internal)
const bvector_type * get_null_bvector() const BMNOEXCEPT
Get bit-vector of assigned values or NULL (if not constructed that way)
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.
enumerator first() const
Returns enumerator pointing on the first non-zero bit.
succinct sparse vector with runtime compression using bit-slicing / 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
void clear(size_type idx, bool set_null)
clear 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.
@ use_null
support "non-assigned" or "NULL" logic
static void print_svector(const bm::sparse_vector< unsigned, bm::bvector<> > &sv)