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);
159 assert(cmp==0); (void)cmp;
162 cout <<
"Gather deserialization check OK" << endl;
166 catch(std::exception& ex)
168 std::cerr << ex.what() << std::endl;
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
#define BM_DECLARE_TEMP_BLOCK(x)
Serialization for sparse_vector<>
string sparse vector based on bit-transposed matrix
pre-processor un-defines to avoid global space pollution (internal)
Bitvector Bit-vector container with runtime compression of bits.
bvector_size_type size_type
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
void deserialize(SV &sv, const unsigned char *buf, bool clear_sv=true)
void deserialize_range(SV &sv, const unsigned char *buf, size_type from, size_type to, bool clear_sv=true)
void set_bookmarks(bool enable, unsigned bm_interval=256) BMNOEXCEPT
Add skip-markers for faster range deserialization.
void serialize(const SV &sv, sparse_vector_serial_layout< SV > &sv_layout)
Serialize sparse vector into a memory buffer(s) structure.
succinct sparse vector for strings with compression using bit-slicing ( transposition) method
void optimize(bm::word_t *temp_block=0, typename bvector_type::optmode opt_mode=bvector_type::opt_compress, typename str_sparse_vector< CharType, BV, STR_SIZE >::statistics *stat=0)
run memory optimization for all vector planes
void calc_stat(struct str_sparse_vector< CharType, BV, STR_SIZE >::statistics *st) const BMNOEXCEPT
Calculates memory statistics.
void remap_from(const str_sparse_vector &str_sv, octet_freq_matrix_type *omatrix=0)
Build remapping profile and load content from another sparse vector Remapped vector likely saves memo...
size_type get(size_type idx, value_type *str, size_type buf_size) const BMNOEXCEPT
get specified element
back_insert_iterator get_back_inserter()
Provide back insert iterator Back insert iterator implements buffered insertion, which is faster,...
bm::str_sparse_vector< char, bvector_type, 5 > str_sv_type
size_t memory_used
memory usage for all blocks and service tables
layout class for serialization buffer structure
size_t size() const BMNOEXCEPT
return current serialized size
const unsigned char * buf() const BMNOEXCEPT
Return serialization buffer pointer.