Go to the documentation of this file. 1 #ifndef BMSTRSPARSEVEC__H__INCLUDED__
2 #define BMSTRSPARSEVEC__H__INCLUDED__
32 #ifndef BM__H__INCLUDED__
35 # error missing include (bm.h or bm64.h)
55 template<
typename CharType,
typename BV,
unsigned MAX_STR_SIZE>
81 bm::heap_matrix<
unsigned char,
99 : str_sv_(str_sv), idx_(idx)
104 str_sv_.get(idx_, buf_, MAX_STR_SIZE);
109 {
return bool(*
this) == bool(ref); }
110 bool is_null()
const {
return str_sv_.is_null(idx_); }
114 mutable CharType buf_[MAX_STR_SIZE];
126 : str_sv_(str_sv), idx_(idx)
131 str_sv_.get(idx_, buf_, MAX_STR_SIZE);
144 str_sv_.set(idx_, str);
148 {
return bool(*
this) == bool(ref); }
149 bool is_null()
const {
return str_sv_.is_null(idx_); }
153 mutable CharType buf_[MAX_STR_SIZE];
192 {
return (pos_ == it.pos_) && (sv_ == it.sv_); }
196 {
return pos_ < it.pos_; }
198 {
return pos_ <= it.pos_; }
200 {
return pos_ > it.pos_; }
202 {
return pos_ >= it.pos_; }
237 typedef bm::heap_matrix<CharType,
289 this->
flush(); sv_ = bi.sv_;
297 { this->
add(v);
return *
this; }
301 template<
typename StrType>
304 this->
add(v.c_str());
return *
this;
340 n_buf_size = 1024 * 8
342 typedef bm::heap_matrix<CharType,
350 buffer_matrix_type buf_matrix_;
455 template<
typename StrType>
458 this->
insert(idx, str.c_str());
489 template<
typename StrType>
492 if (idx >= this->
size())
505 CharType ch = str[i];
510 ch = CharType(remap_value);
527 template<
typename StrType>
545 template<
typename StrType>
549 for (
unsigned i = 0; i < MAX_STR_SIZE; ++i)
557 unsigned char remap_value = remap_row[unsigned(ch)];
564 ch = CharType(remap_value);
704 const_iterator
begin()
const;
823 template<
typename CharMatrix>
826 bool zero_mem =
true)
const
835 if (max_sz < dec_size)
842 for (
unsigned i = 0; i < MAX_STR_SIZE; ++i)
845 for (
unsigned k = i * 8; k < (i * 8) + 8; ++k, ++bi)
852 for ( ;en.
valid(); ++en )
857 typename CharMatrix::value_type* str = cmatr.row(idx);
865 for (
unsigned i = 0; i < dec_size; ++i)
867 typename CharMatrix::value_type* str = cmatr.row(i);
883 template<
typename CharMatrix>
888 if (idx_from < this->
size_)
891 this->
clear_range(idx_from, idx_from + imp_size - 1);
904 template<
typename CharMatrix>
918 void sync(
bool force);
946 template<
typename CharMatrix>
949 bool set_not_null =
true)
953 unsigned max_str_size = 0;
955 for (
unsigned j = 0; j < imp_size; ++j)
957 typename CharMatrix::value_type* str = cmatr.row(j);
959 for (i = 0; i < MAX_STR_SIZE; ++i)
964 max_str_size = (i > max_str_size) ? i : max_str_size;
973 str[i] = CharType(remap_value);
976 if (i == MAX_STR_SIZE)
982 for (
unsigned i = 0; i < max_str_size; ++i)
984 for (
unsigned bi = 0; bi < 8; ++bi)
990 typename CharMatrix::value_type* str = cmatr.row(j);
1002 unsigned plain = i*8 + bi;
1014 size_type idx_to = idx_from + imp_size - 1;
1019 bv_null->set_range(idx_from, idx_to);
1021 if (idx_to >= this->
size())
1022 this->
size_ = idx_to+1;
1086 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1099 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1103 remap_flags_(str_sv.remap_flags_),
1104 remap_matrix1_(str_sv.remap_matrix1_),
1105 remap_matrix2_(str_sv.remap_matrix2_)
1110 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1113 parent_type::swap(str_sv);
1115 remap_matrix1_.swap(str_sv.remap_matrix1_);
1116 remap_matrix2_.swap(str_sv.remap_matrix2_);
1121 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1125 if (idx >= this->size())
1126 this->size_ = idx+1;
1127 set_value(idx, str);
1132 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1136 if (idx >= this->size())
1138 this->size_ = idx+1;
1139 set_value(idx, str);
1142 insert_value(idx, str);
1148 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1152 if (idx >= this->size_)
1154 this->erase_column(idx);
1160 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1165 bv_null->clear_bit_no_check(idx);
1166 if (idx >= this->size_)
1168 this->size_ = idx + 1;
1174 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1178 set_value_no_null(idx, str);
1181 bv_null->set_bit_no_check(idx);
1186 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1190 for (
unsigned i = 0; i < MAX_STR_SIZE; ++i)
1192 CharType ch = str[i];
1195 this->clear_value_plains_from(i*8, idx);
1201 unsigned char remap_value = remap_matrix2_.get(i,
unsigned(ch));
1205 this->clear_value_plains_from(i*8, idx);
1208 ch = CharType(remap_value);
1210 this->bmatr_.set_octet(idx, i, (
unsigned char)ch);
1216 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1220 insert_value_no_null(idx, str);
1221 this->insert_null(idx,
true);
1226 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1230 for (
unsigned i = 0; i < MAX_STR_SIZE; ++i)
1232 CharType ch = str[i];
1235 this->insert_clear_value_plains_from(i*8, idx);
1241 unsigned char remap_value = remap_matrix2_.get(i,
unsigned(ch));
1245 this->insert_clear_value_plains_from(i*8, idx);
1248 ch = CharType(remap_value);
1250 this->bmatr_.insert_octet(idx, i, (
unsigned char)ch);
1257 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1263 for (; i < MAX_STR_SIZE; ++i)
1269 CharType ch = CharType(this->bmatr_.get_octet(idx, i));
1279 remap_matrix1_.remap(str, i);
1286 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1293 parent_type::optimize(temp_block, opt_mode, &stbv);
1301 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1307 parent_type::calc_stat(&stbv);
1318 size_t remap_mem_usage =
sizeof(remap_flags_);
1319 remap_mem_usage += remap_matrix1_.get_buffer().mem_usage();
1320 remap_mem_usage += remap_matrix2_.get_buffer().mem_usage();
1331 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1338 for (
unsigned i = 0; i < MAX_STR_SIZE; ++i)
1340 CharType ch = str[i];
1341 if (remap_flags_ && ch)
1343 unsigned char remap_value = remap_matrix2_.get(i,
unsigned(ch));
1348 ch = CharType(remap_value);
1351 res = this->bmatr_.compare_octet(idx, i, ch);
1360 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1365 for (; i < MAX_STR_SIZE; ++i)
1367 CharType ch1 = CharType(this->bmatr_.get_octet(idx1, i));
1368 CharType ch2 = CharType(this->bmatr_.get_octet(idx2, i));
1386 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1398 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1402 for (
int i = MAX_STR_SIZE-1; i >= 0; --i)
1404 unsigned octet_plain = unsigned(i) * unsigned(
sizeof(CharType)) * 8;
1405 for (
unsigned j = 0; j <
sizeof(CharType) * 8; ++j)
1407 if (this->bmatr_.row(octet_plain+j))
1408 return unsigned(i)+1;
1416 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1420 octet_matrix.init();
1421 octet_matrix.set_zero();
1425 for (
unsigned i = 0; i < MAX_STR_SIZE; ++i)
1427 unsigned char* row = octet_matrix.row(i);
1432 unsigned char ch = this->bmatr_.get_octet(j, i);
1442 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1448 octet_remap_matrix1.init();
1449 octet_remap_matrix1.set_zero();
1450 octet_remap_matrix2.init();
1451 octet_remap_matrix2.set_zero();
1453 for (
unsigned i = 0; i < octet_occupancy_matrix.rows(); ++i)
1455 const unsigned char* row = octet_occupancy_matrix.row(i);
1456 unsigned char* remap_row1 = octet_remap_matrix1.row(i);
1457 unsigned char* remap_row2 = octet_remap_matrix2.row(i);
1459 for (
unsigned j = 1; j < octet_occupancy_matrix.cols(); ++j)
1464 remap_row1[count] = (
unsigned char)j;
1465 remap_row2[j] = (
unsigned char)count;
1475 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1480 remap_matrix2_.init();
1481 remap_matrix2_.set_zero();
1483 for (
unsigned i = 0; i < remap_matrix1_.rows(); ++i)
1485 const unsigned char* remap_row1 = remap_matrix1_.row(i);
1486 unsigned char* remap_row2 = remap_matrix2_.row(i);
1487 for (
unsigned j = 1; j < remap_matrix1_.cols(); ++j)
1491 unsigned count = remap_row1[j];
1492 remap_row2[count] = (
unsigned char)j;
1501 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1508 for (
unsigned i = 0; i < buf_size; ++i)
1510 CharType ch = str[i];
1516 const unsigned char* remap_row = octet_remap_matrix2.row(i);
1517 unsigned char remap_value = remap_row[unsigned(ch)];
1522 sv_str[i] = CharType(remap_value);
1529 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1536 for (
unsigned i = 0; i < buf_size; ++i)
1538 CharType ch = sv_str[i];
1544 const unsigned char* remap_row = octet_remap_matrix1.row(i);
1545 unsigned char remap_value = remap_row[unsigned(ch)];
1550 str[i] = CharType(remap_value);
1557 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1577 const unsigned buffer_size = 1024 * 8;
1579 typedef bm::heap_matrix<CharType,
1584 remap_buffer_type cmatr(
true);
1590 this->
import(cmatr, i, dsize);
1597 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1602 recalc_remap_matrix2();
1608 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1623 b = remap_matrix1_.get_buffer().equal(sv.
remap_matrix1_.get_buffer());
1626 b = remap_matrix2_.get_buffer().equal(sv.
remap_matrix2_.get_buffer());
1630 return parent_type::equal(sv, null_able);
1635 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1641 return it_type(
this);
1646 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1649 parent_type::clear();
1654 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1656 const char* err_msg)
1659 throw std::range_error(err_msg);
1667 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1669 const char* err_msg)
1673 err_msg =
"Unknown/incomparable dictionary character";
1674 throw std::domain_error(err_msg);
1686 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1693 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1696 : sv_(it.sv_), pos_(it.pos_), pos_in_buf_(~
size_type(0))
1701 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1709 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1718 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1726 if (!buf_matrix_.is_init())
1729 size_type d = sv_->decode(buf_matrix_, pos_, buffer_matrix_type::n_rows);
1736 return buf_matrix_.row(pos_in_buf_);
1741 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1751 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1758 if (pos_ >= sv_->size())
1765 if (pos_in_buf_ >= buffer_matrix_type::n_rows)
1775 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1777 : sv_(0), bv_null_(0), pos_in_buf_(~
size_type(0))
1782 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1792 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1795 : sv_(bi.sv_), bv_null_(bi.bv_null_), pos_in_buf_(~
size_type(0))
1802 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1810 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1813 return (pos_in_buf_ == ~
size_type(0) || !sv_);
1818 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1824 sv_->import_no_check(buf_matrix_, sv_->size(), pos_in_buf_+1,
false);
1830 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1843 bv_null_->set_bit_no_check(sz + buf_idx);
1849 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1852 this->add_value(
"");
1857 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1862 this->add_value(
"");
1868 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1877 if (!buf_matrix_.is_init())
1880 buf_matrix_.set_zero();
1883 if (pos_in_buf_ >= buffer_matrix_type::n_rows-1)
1887 buf_matrix_.set_zero();
1893 value_type* r = buf_matrix_.row(pos_in_buf_);
1894 for (
unsigned i = 0; i < buffer_matrix_type::n_columns; ++i)
size_type effective_max_str() const
get effective string length used in vector
void flush()
flush the accumulated buffer
bvector_type_ptr plain(unsigned i)
get access to bit-plain as is (can return NULL)
unsigned char * init_remap_buffer()
void insert(size_type idx, const StrType &str)
insert STL string
Constants, tables and typedefs.
str_sparse_vector< CharType, BV, MAX_STR_SIZE > str_sparse_vector_type
bvector_type::allocator_type allocator_type
size_t max_serialize_mem
estimated maximum memory for serialization
allocator_type::allocator_pool_type allocator_pool_type
bmatrix_type bmatr_
bit-transposed matrix
sparse vector de-serializer
str_sparse_vector_type::size_type size_type
const value_type * operator*() const
Get current position (value)
plain_octet_matrix_type remap_matrix2_
octet remap table 2
allocator_type::allocator_pool_type allocator_pool_type
bool valid() const
Checks if iterator is still valid. Analog of != 0 comparison for pointers.
str_sparse_vector_type::bvector_type bvector_type
void clear_value_plains_from(unsigned plain_idx, size_type idx)
void go_to(size_type pos)
re-position to a specified position
size_type size_internal() const
optmode
Optimization mode Every next level means additional checks (better compression vs time)
bool remap_tosv(value_type *sv_str, size_type buf_size, const value_type *str) const
back_insert_iterator & operator++(int)
noop
size_type pos() const
Current position (index) in the vector.
bm::heap_matrix< CharType, 1024, MAX_STR_SIZE, allocator_type > buffer_matrix_type
void swap(base_sparse_vector< CharType, BV, MAX_SIZE > &bsv) BMNOEXEPT
reference & operator=(const reference &ref)
void push_back(const StrType &str)
push back a string
unsigned char get_octet(size_type pos, size_type octet_idx) const
size_t bit_blocks
Number of bit blocks.
void resize_internal(size_type sz)
Base class for bit-transposed sparse vector construction.
const value_type * value() const
Get current position (value)
@ no_null
do not support NULL values
const unsigned char * get_remap_buffer() const
allocator_type::allocator_pool_type allocator_pool_type
str_sparse_vector_type::value_type value_type
void insert_value_no_null(size_type idx, const value_type *str)
insert value without checking boundaries or support of NULL
static void throw_bad_value(const char *err_msg)
throw domain error
void set_value(size_type idx, const value_type *str)
set value without checking boundaries
bool operator<(const const_iterator &it) const
void get(size_type idx, StrType &str) const
get specified string element
void insert_value(size_type idx, const value_type *str)
insert value without checking boundaries
@ BM_SORTED
input set is sorted (ascending order)
void reset()
Reset statisctics.
bm::heap_matrix< unsigned char, MAX_STR_SIZE, 256, typename bvector_type::allocator_type > plain_octet_matrix_type
Constant iterator designed to enumerate "ON" bits.
#define BM_ASSERT_THROW(x, xerrcode)
size_type effective_vector_max() const
get effective string length used in vector
void calc_stat(struct str_sparse_vector< CharType, BV, MAX_STR_SIZE >::statistics *st) const
Calculates memory statistics.
back_insert_iterator & operator=(const value_type *v)
push value to the vector
bvector_type::enumerator bvector_enumerator_type
Algorithms for bvector<> (main include)
size_t gap_blocks
Number of GAP blocks.
const_reference(const str_sparse_vector< CharType, BV, MAX_STR_SIZE > &str_sv, size_type idx) BMNOEXEPT
reference operator[](size_type idx)
Operator to get write access to an element
base_sparse_vector< CharType, BV, MAX_STR_SIZE > parent_type
back_insert_iterator & operator*()
noop
bool equal(const str_sparse_vector< CharType, BV, MAX_STR_SIZE > &sv, bm::null_support null_able=bm::use_null) const
check if another sparse vector has the same content and size
void push_back(const value_type *str)
push back a string (zero terminated)
size_type get(size_type idx, value_type *str, size_type buf_size) const
get specified element
bool empty() const
return true if vector is empty
const typedef bvector_type * bvector_type_const_ptr
void set_null(size_type idx)
set NULL status for the specified element Vector is resized automatically
const typedef value_type & const_reference
BV::allocator_type allocator_type
void xor_swap(W &x, W &y)
XOR swap two scalar variables.
Bitvector Bit-vector container with runtime compression of bits.
@ use_null
support "non-assigned" or "NULL" logic
size_type size() const
return size of the vector
static bool is_compressed()
trait if sparse vector is "compressed" (false)
Reference class to access elements via common [] operator.
sparse vector for strings with compression using bit transposition method
void swap(str_sparse_vector &str_sv) BMNOEXEPT
void clear_range(size_type left, size_type right, bool set_null)
bvector_type * get_null_bvect()
unsigned remap_flags_
remapping status
back_insert_iterator & operator=(const StrType &v)
push value to the vector
void set_octet(size_type pos, size_type octet_idx, unsigned char octet)
str_sparse_vector< CharType, BV, MAX_STR_SIZE > & operator=(const str_sparse_vector< CharType, BV, MAX_STR_SIZE > &str_sv)
back_insert_iterator get_back_inserter()
Provide back insert iterator Back insert iterator implements buffered insertion, which is faster,...
const_iterator end() const
Provide const iterator access to the end
@ opt_compress
compress blocks when possible (GAP/prefix sum)
size_t remap_size() const
Reference class to access elements via common [] operator.
size_type size_
array size
bvector_type::allocator_type allocator_type
str_sparse_vector_type::size_type size_type
void invalidate()
Invalidate current iterator.
bvector_type * bvector_type_ptr
size_type decode(CharMatrix &cmatr, size_type idx_from, size_type dec_size, bool zero_mem=true) const
Bulk export strings to a C-style matrix of chars.
reference(str_sparse_vector< CharType, BV, MAX_STR_SIZE > &str_sv, size_type idx) BMNOEXEPT
void resize(size_type new_size)
void sync(bool force)
syncronize internal structures
static bool find_rank(size_type rank, size_type &pos)
find position of compressed element by its rank
bool operator==(const const_iterator &it) const
back_insert_iterator & operator=(const back_insert_iterator &bi)
str_sparse_vector(str_sparse_vector< CharType, BV, MAX_STR_SIZE > &&str_sv) BMNOEXEPT
bvector_type::allocation_policy allocation_policy_type
bvector_type::size_type size_type
bool is_null(size_type idx) const
test if specified element is NULL
Const iterator to do quick traverse of the sparse vector.
static void build_octet_remap(plain_octet_matrix_type &octet_remap_matrix1, plain_octet_matrix_type &octet_remap_matrix2, const plain_octet_matrix_type &octet_occupancy_matrix)
unsigned bit_list(T w, B *bits)
Unpacks word into list of ON bit indexes.
void add(const value_type *v)
add value to the container
plain_octet_matrix_type remap_matrix1_
octet remap table 1
bool operator!=(const const_iterator &it) const
long long difference_type
bool operator==(const reference &ref) const
str_sparse_vector< CharType, BV, MAX_STR_SIZE > & clear_range(size_type left, size_type right, bool set_null=false)
clear range (assign bit 0 for all plains)
bool is_null() const
Get NULL status.
bvector_type_ptr construct_row(size_type row)
size_t ptr_sub_blocks
Number of sub-blocks.
static bool remap_fromsv(value_type *str, size_type buf_size, const value_type *sv_str, const plain_octet_matrix_type &octet_remap_matrix1)
Basic dense bit-matrix class.
const_reference operator[](size_type idx) const
Operator to get read access to an element
void copy_from(const base_sparse_vector< CharType, BV, MAX_SIZE > &bsv)
void calc_octet_stat(plain_octet_matrix_type &octet_matrix) const
bool operator==(const const_reference &ref) const
const_iterator begin() const
Provide const iterator access to container content
void add(const bv_statistics &st)
Sum data from another sttructure.
bool operator>=(const const_iterator &it) const
reference & operator=(const value_type *str)
str_sparse_vector(bm::null_support null_able=bm::no_null, allocation_policy_type ap=allocation_policy_type(), size_type bv_max_size=bm::id_max, const allocator_type &alloc=allocator_type())
Sparse vector constructor.
size_t bv_count
Number of bit-vectors.
void import_no_check(CharMatrix &cmatr, size_type idx_from, size_type imp_size, bool set_not_null=true)
bool operator>(const const_iterator &it) const
const_iterator & operator++()
Advance to the next available value.
basic bit-matrix class and utilities
str_sparse_vector_type::bvector_type bvector_type
static bool remap_tosv(value_type *sv_str, size_type buf_size, const value_type *str, const plain_octet_matrix_type &octet_remap_matrix2)
Back insert iterator implements buffered insert, faster than generic access assignment.
void insert(size_type idx, const value_type *str)
insert the specified element
static void throw_range_error(const char *err_msg)
throw range error
std::output_iterator_tag iterator_category
size_t memory_used
memory usage for all blocks and service tables
str_sparse_vector_type * str_sparse_vector_type_ptr
bool operator<=(const const_iterator &it) const
null_support
NULL-able value support.
void resize(size_type sz)
resize vector
int compare(size_type idx, const value_type *str) const
Compare vector element with argument lexicographically.
bool valid() const
Returns true if iterator is at a valid position.
Utilities for bit transposition (internal) (experimental!)
void recalc_remap_matrix2()
void set_value_no_null(size_type idx, const value_type *str)
set value without checking boundaries or support of NULL
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
str_sparse_vector_type::value_type value_type
void add_null()
add NULL (no-value) to the container
str_sparse_vector< CharType, BV, MAX_STR_SIZE > str_sparse_vector_type
std::input_iterator_tag iterator_category
bool empty() const
return true if insertion buffer is empty
void import_back(CharMatrix &cmatr, size_type imp_size)
Bulk push-back import of strings from a C-style matrix of chars.
void set(size_type idx, const value_type *str)
set specified element with bounds checking and automatic resize
size_type add_value(const value_type *v)
add value to the buffer without changing the NULL vector
Structure with statistical information about memory allocation footprint, serialization projection,...
void advance()
advance iterator forward by one
void assign(size_type idx, const StrType &str)
set specified element with bounds checking and automatic resize
const_iterator get_const_iterator(size_type idx) const
Get const_itertor re-positioned to specific element.
bool is_remap() const
Get remapping status (true|false)
void remap_from(const str_sparse_vector &str_sv)
Build remapping profile and load content from another sparse vector.
void clear() BMNOEXEPT
resize to zero, free memory
static size_type max_str()
get maximum string length capacity
size_type effective_size() const
size of sparse vector (may be different for RSC)
back_insert_iterator & operator++()
noop
bvector_type_const_ptr get_row(size_type i) const
Statistical information about bitset's memory allocation details.
unsigned common_prefix_length(size_type idx1, size_type idx2) const
Find size of common prefix between two vector elements in octets.
void erase(size_type idx)
erase the specified element
bm::basic_bmatrix< BV > bmatrix_type
const_iterator & operator++(int)
Advance to the next available value.
str_sparse_vector_type * str_sparse_vector_type_ptr