Go to the documentation of this file.
70 for (
unsigned i = 0; i < 100000; ++i)
89 cout <<
"Used memory: " << st.
memory_used << std::endl;
114 sv_serializer.
serialize(str_sv1, sv_lay);
116 const unsigned char* buf = sv_lay.
buf();
117 cout <<
"Serialized size = " << sv_lay.
size() << endl;
148 char s1[16];
char s2[16];
char s3[16];
151 str_sv1.
get(j, s1,
sizeof(s1));
152 str_sv2.
get(j, s2,
sizeof(s2));
153 str_sv3.
get(j, s3,
sizeof(s3));
156 cmp = ::strcmp(s1, s2);
158 cmp = ::strcmp(s1, s3);
162 cout <<
"Gather deserialization check OK" << endl;
166 catch(std::exception& ex)
168 std::cerr << ex.what() << std::endl;
bvector< Alloc > & set_range(size_type left, size_type right, bool value=true)
Sets all bits in the specified closed interval [left,right] Interval must be inside the bvector's siz...
sparse vector de-serializer
size_type get(size_type idx, value_type *str, size_type buf_size) const BMNOEXCEPT
get specified element
#define BM_DECLARE_TEMP_BLOCK(x)
const unsigned char * buf() const
Return serialization buffer pointer.
void calc_stat(struct str_sparse_vector< CharType, BV, MAX_STR_SIZE >::statistics *st) const BMNOEXCEPT
Calculates memory statistics.
Serialization for sparse_vector<>
layout class for serialization buffer structure
sparse vector for strings with compression using bit transposition method
string sparse vector based on bit-transposed matrix
back_insert_iterator get_back_inserter()
Provide back insert iterator Back insert iterator implements buffered insertion, which is faster,...
void serialize(const SV &sv, sparse_vector_serial_layout< SV > &sv_layout)
Serialize sparse vector into a memory buffer(s) structure.
bm::str_sparse_vector< char, bvector_type, 5 > str_sv_type
void deserialize(SV &sv, const unsigned char *buf)
void set_bookmarks(bool enable, unsigned bm_interval=256)
Add skip-markers for faster range deserialization.
size_t size() const
return current serialized size
size_t memory_used
memory usage for all blocks and service tables
void deserialize_range(SV &sv, const unsigned char *buf, size_type from, size_type to)
void optimize(bm::word_t *temp_block=0, typename bvector_type::optmode opt_mode=bvector_type::opt_compress, typename str_sparse_vector< CharType, BV, MAX_STR_SIZE >::statistics *stat=0)
run memory optimization for all vector plains
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
void remap_from(const str_sparse_vector &str_sv)
Build remapping profile and load content from another sparse vector.