56 for (
unsigned i = 0; i < 128000; ++i)
70 const unsigned char* buf = sv_lay.
buf();
71 size_t buf_size = sv_lay.
size();
73 vector<unsigned char> tmp_buf(buf_size);
74 ::memcpy(&tmp_buf[0], buf, buf_size);
79 cerr <<
"De-Serialization error!" << endl;
86 cerr <<
"Error! Please report a bug to BitMagic project support." << endl;
90 cout << sv2.
size() << endl;
92 catch(std::exception& ex)
94 std::cerr << ex.what() << std::endl;
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.
Serialization for sparse_vector<>
sparse vector with runtime compression using bit transposition method
bool equal(const sparse_vector< Val, BV > &sv, bm::null_support null_able=bm::use_null) const BMNOEXCEPT
check if another sparse vector has the same content and size
void push_back(value_type v)
push value back into vector
size_type size() const BMNOEXCEPT
return size of the vector
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 plains
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.
int sparse_vector_deserialize(SV &sv, const unsigned char *buf, bm::word_t *temp_block=0)
Deserialize sparse vector.
layout class for serialization buffer structure
size_t size() const
return current serialized size
const unsigned char * buf() const
Return serialization buffer pointer.
bm::sparse_vector< unsigned, bm::bvector<> > svector