Go to the documentation of this file.
58 std::cout << sv.size() <<
": ";
59 for (
unsigned i = 0; i < sv.size(); ++i)
64 std::cout <<
"NULL, ";
67 typename SV::value_type v = sv.get(i);
68 std::cout << v <<
", ";
73 typename SV::value_type v = sv.get(i);
74 std::cout << v <<
", ";
77 std::cout << std::endl;
91 for (
unsigned i = 0; i < 15; i+=3)
114 const unsigned char* buf = sv_lay.
buf();
115 size_t buf_size = sv_lay.
size();
117 vector<unsigned char> tmp_buf(buf_size);
118 ::memcpy(&tmp_buf[0], buf, buf_size);
126 std::cerr <<
"De-Serialization error!" << std::endl;
129 if (!csv3.
equal(csv2) )
131 cerr <<
"Error! Please report a bug to BitMagic project support." << endl;
139 if (!sv3.
equal(sv1) )
141 std::cerr <<
"Error! Please report a bug to BitMagic project support." << std::endl;
148 catch(std::exception& ex)
150 std::cerr << ex.what() << std::endl;
int sparse_vector_deserialize(SV &sv, const unsigned char *buf, bm::word_t *temp_block=0)
Deserialize sparse vector.
void load_to(sparse_vector_type &sv) const
Exort compressed vector to a sparse vector (with NULLs)
sparse vector with runtime compression using bit transposition method
#define BM_DECLARE_TEMP_BLOCK(x)
const unsigned char * buf() const
Return serialization buffer pointer.
Sparse constainer sparse_vector<> for integer types using bit-transposition transform.
Serialization for sparse_vector<>
bool equal(const sparse_vector< Val, BV > &sv, bm::null_support null_able=bm::use_null) const
check if another sparse vector has the same content and size
void sparse_vector_serialize(const SV &sv, sparse_vector_serial_layout< SV > &sv_layout, bm::word_t *temp_block=0)
Serialize sparse vector into a memory buffer(s) structure.
Compressed sparse container rsc_sparse_vector<> for integer types.
layout class for serialization buffer structure
@ use_null
support "non-assigned" or "NULL" logic
bm::sparse_vector< unsigned, bm::bvector<> > sparse_vector_u32
bool equal(const rsc_sparse_vector< Val, SV > &csv) const
check if another vector has the same content
void load_from(const sparse_vector_type &sv_src)
Load compressed vector from a sparse vector (with NULLs)
Rank-Select compressed sparse vector.
bm::rsc_sparse_vector< unsigned, sparse_vector_u32 > rsc_sparse_vector_u32
void optimize(bm::word_t *temp_block=0, typename bvector_type::optmode opt_mode=bvector_type::opt_compress, statistics *stat=0)
run memory optimization for all vector plains
size_t size() const
return current serialized size
void print_svector(const SV &sv, bool show_nulls=false)
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.