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)
102 operator const value_type*()
const 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)
129 operator const value_type*()
const 131 str_sv_.get(idx_, buf_, MAX_STR_SIZE);
138 str_sv_.set(idx_, (
const value_type*)ref);
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_); }
194 {
return ! operator==(it); }
196 {
return pos_ < it.pos_; }
198 {
return pos_ <= it.pos_; }
200 {
return pos_ > it.pos_; }
202 {
return pos_ >= it.pos_; }
205 const value_type*
operator*()
const {
return this->value(); }
216 const value_type* value()
const;
219 bool is_null()
const {
return sv_->is_null(this->pos_); }
228 size_type
pos()
const {
return pos_; }
231 void go_to(size_type pos);
237 typedef bm::heap_matrix<CharType,
243 const str_sparse_vector_type* sv_;
244 mutable size_type pos_;
245 mutable buffer_matrix_type buf_matrix_;
246 mutable size_type pos_in_buf_;
289 this->flush(); sv_ = bi.sv_;
297 { this->
add(v);
return *
this; }
301 template<
typename StrType>
304 this->
add(v.c_str());
return *
this;
315 void add(
const value_type* v);
321 void add_null(size_type count);
335 size_type add_value(
const value_type* v);
340 n_buf_size = 1024 * 8
342 typedef bm::heap_matrix<CharType,
345 allocator_type> buffer_matrix_type;
348 str_sparse_vector_type* sv_;
349 bvector_type* bv_null_;
350 buffer_matrix_type buf_matrix_;
351 size_type pos_in_buf_;
432 void set(size_type idx,
const value_type* str);
447 void insert(size_type idx,
const value_type* str);
455 template<
typename StrType>
456 void insert(size_type idx,
const StrType& str)
458 this->
insert(idx, str.c_str());
465 void erase(size_type idx);
476 size_type
get(size_type idx, value_type* str, size_type buf_size)
const;
489 template<
typename StrType>
490 void assign(size_type idx,
const StrType& str)
492 if (idx >= this->
size())
495 size_type str_size =
size_type(str.size());
496 size_type sz =
size_type((str_size < MAX_STR_SIZE) ? str_size : MAX_STR_SIZE-1);
505 CharType ch = str[i];
510 ch = CharType(remap_value);
527 template<
typename StrType>
545 template<
typename StrType>
546 void get(size_type idx, StrType& str)
const 549 for (
unsigned i = 0; i < MAX_STR_SIZE; ++i)
557 unsigned char remap_value = remap_row[unsigned(ch)];
564 ch = CharType(remap_value);
592 int compare(size_type idx,
const value_type* str)
const;
618 clear_range(size_type left, size_type right,
bool set_null =
false)
776 const value_type* str,
785 const value_type* str)
const 798 const value_type* sv_str,
823 template<
typename CharMatrix>
825 size_type idx_from, size_type dec_size,
826 bool zero_mem =
true)
const 832 size_type rows =
size_type(cmatr.rows());
834 size_type max_sz = this->
size() - idx_from;
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 )
854 size_type idx = *en - idx_from;
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>
884 void import(CharMatrix& cmatr, size_type idx_from, size_type imp_size)
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);
936 bool find_rank(size_type rank, size_type& pos);
946 template<
typename CharMatrix>
948 size_type idx_from, size_type imp_size,
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)
961 value_type ch = str[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)
981 size_type
bit_list[CharMatrix::n_rows];
982 for (
unsigned i = 0; i < max_str_size; ++i)
984 for (
unsigned bi = 0; bi < 8; ++bi)
988 for (size_type j = 0; j < imp_size; ++j)
990 typename CharMatrix::value_type* str = cmatr.row(j);
991 value_type ch = str[i];
996 bit_list[n_bits++] = idx_from + j;
1002 unsigned plain = i*8 + bi;
1009 bv->set(&bit_list[0], n_bits,
BM_SORTED);
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;
1047 void set_value(size_type idx,
const value_type* str);
1053 void insert_value(size_type idx,
const value_type* str);
1086 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1099 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1110 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1121 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1125 if (idx >= this->
size())
1126 this->
size_ = idx+1;
1132 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1136 if (idx >= this->
size())
1138 this->
size_ = idx+1;
1148 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1152 if (idx >= this->size_)
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>
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];
1208 ch = CharType(remap_value);
1216 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
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];
1248 ch = CharType(remap_value);
1257 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1263 for (; i < MAX_STR_SIZE; ++i)
1286 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1301 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
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];
1348 ch = CharType(remap_value);
1360 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
1365 for (; i < MAX_STR_SIZE; ++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)
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);
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>
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>
1608 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
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>
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>
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>
1857 template<
class CharType,
class BV,
unsigned MAX_STR_SIZE>
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)
str_sparse_vector_type * str_sparse_vector_type_ptr
bvector_type * get_null_bvect()
bvector_type::enumerator bvector_enumerator_type
unsigned remap_flags_
remapping status
void add_null()
add NULL (no-value) to the container
reference operator[](size_type idx)
Operator to get write access to an element.
bool remap_tosv(value_type *sv_str, size_type buf_size, const value_type *str) const
void sync(bool force)
syncronize internal structures
str_sparse_vector_type::bvector_type bvector_type
back_insert_iterator & operator*()
noop
size_t gap_blocks
Number of GAP blocks.
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
bvector_type * bvector_type_ptr
reference(str_sparse_vector< CharType, BV, MAX_STR_SIZE > &str_sv, size_type idx) BMNOEXEPT
void import_no_check(CharMatrix &cmatr, size_type idx_from, size_type imp_size, bool set_not_null=true)
back_insert_iterator & operator=(const value_type *v)
push value to the vector
Base class for bit-transposed sparse vector construction.
bvector_type::allocation_policy allocation_policy_type
void optimize(bm::word_t *temp_block=0, typename bvector_type::optmode opt_mode=bvector_type::opt_compress, typename bvector_type::statistics *stat=0)
run memory optimization for all bit-vector rows
bool is_remap() const
Get remapping status (true|false)
unsigned char get_octet(size_type pos, size_type octet_idx) const
const_iterator get_const_iterator(size_type idx) const
Get const_itertor re-positioned to specific element.
unsigned char * init_remap_buffer()
void insert_clear_value_plains_from(unsigned plain_idx, size_type idx)
Constants, tables and typedefs.
void invalidate()
Invalidate current iterator.
bool operator==(const const_reference &ref) const
bm::basic_bmatrix< BV > bmatrix_type
unsigned common_prefix_length(size_type idx1, size_type idx2) const
Find size of common prefix between two vector elements in octets.
void clear_range(size_type left, size_type right, bool set_null)
const_iterator & operator++(int)
Advance to the next available value.
back_insert_iterator & operator=(const back_insert_iterator &bi)
void resize(size_type sz)
resize vector
void clear() BMNOEXEPT
resize to zero, free memory
bool operator==(const const_iterator &it) const
basic bit-matrix class and utilities
BV::allocator_type allocator_type
void calc_stat(typename bvector_type::statistics *st) const
Calculates memory statistics.
void set_value_no_null(size_type idx, const value_type *str)
set value without checking boundaries or support of NULL
size_type add_value(const value_type *v)
add value to the buffer without changing the NULL vector
void erase(size_type idx)
erase the specified element
size_t max_serialize_mem
estimated maximum memory for serialization
const bvector_type * row(size_type i) const
const_iterator end() const
Provide const iterator access to the end.
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.
const bvector_type * bvector_type_const_ptr
unsigned bit_list(T w, B *bits)
Unpacks word into list of ON bit indexes.
void xor_swap(W &x, W &y)
XOR swap two scalar variables.
compress blocks when possible (GAP/prefix sum)
void flush()
flush the accumulated buffer
void clear_value_plains_from(unsigned plain_idx, size_type idx)
void push_back(const value_type *str)
push back a string (zero terminated)
do not support NULL values
Statistical information about bitset's memory allocation details.
Algorithms for bvector<> (main include)
allocator_type::allocator_pool_type allocator_pool_type
plain_octet_matrix_type remap_matrix2_
octet remap table 2
Reference class to access elements via common [] operator.
bvector_type_ptr plain(unsigned i)
get access to bit-plain as is (can return NULL)
size_t remap_size() const
null_support
NULL-able value support.
void import_back(CharMatrix &cmatr, size_type imp_size)
Bulk push-back import of strings from a C-style matrix of chars.
static bool find_rank(size_type rank, size_type &pos)
find position of compressed element by its rank
void push_back(const StrType &str)
push back a string
size_t memory_used
memory usage for all blocks and service tables
str_sparse_vector_type::value_type value_type
input set is sorted (ascending order)
str_sparse_vector< CharType, BV, MAX_STR_SIZE > str_sparse_vector_type
void calc_stat(struct str_sparse_vector< CharType, BV, MAX_STR_SIZE >::statistics *st) const
Calculates memory statistics.
Reference class to access elements via common [] operator.
size_t ptr_sub_blocks
Number of sub-blocks.
static bool is_compressed()
trait if sparse vector is "compressed" (false)
size_type size_internal() const
int compare_octet(size_type pos, size_type octet_idx, char octet) const
bvector_type::allocator_type allocator_type
Back insert iterator implements buffered insert, faster than generic access assignment.
void recalc_remap_matrix2()
bvector_type::allocator_type allocator_type
const_reference(const str_sparse_vector< CharType, BV, MAX_STR_SIZE > &str_sv, size_type idx) BMNOEXEPT
support "non-assigned" or "NULL" logic
plain_octet_matrix_type remap_matrix1_
octet remap table 1
Basic dense bit-matrix class.
sparse vector for strings with compression using bit transposition method
reference & operator=(const reference &ref)
void resize(size_type new_size)
void go_to(size_type pos)
re-position to a specified position
std::output_iterator_tag iterator_category
bool equal(const base_sparse_vector< CharType, BV, MAX_SIZE > &sv, bm::null_support null_able=bm::use_null) const
check if another sparse vector has the same content and size
void set_value(size_type idx, const value_type *str)
set value without checking boundaries
bool operator!=(const const_iterator &it) const
bool empty() const
return true if insertion buffer is empty
bool is_null() const
Get NULL status.
str_sparse_vector_type::bvector_type bvector_type
int compare(size_type idx, const value_type *str) const
Compare vector element with argument lexicographically.
void remap_from(const str_sparse_vector &str_sv)
Build remapping profile and load content from another sparse vector.
const value_type & const_reference
str_sparse_vector< CharType, BV, MAX_STR_SIZE > & operator=(const str_sparse_vector< CharType, BV, MAX_STR_SIZE > &str_sv)
void advance()
advance iterator forward by one
void clear() BMNOEXEPT
resize to zero, free memory
void insert_octet(size_type pos, size_type octet_idx, unsigned char octet)
void insert(size_type idx, const value_type *str)
insert the specified element
str_sparse_vector_type::size_type size_type
back_insert_iterator & operator++()
noop
bool valid() const
Checks if iterator is still valid.
void add(const value_type *v)
add value to the container
allocator_type::allocator_pool_type allocator_pool_type
const unsigned char * get_remap_buffer() const
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
allocator_type::allocator_pool_type allocator_pool_type
const_reference operator[](size_type idx) const
Operator to get read access to an element.
void insert(size_type idx, const StrType &str)
insert STL string
std::input_iterator_tag iterator_category
back_insert_iterator & operator=(const StrType &v)
push value to the vector
void reset()
Reset statisctics.
void assign(size_type idx, const StrType &str)
set specified element with bounds checking and automatic resize
void copy_from(const base_sparse_vector< CharType, BV, MAX_SIZE > &bsv)
#define BM_ASSERT_THROW(x, xerrcode)
bm::heap_matrix< unsigned char, MAX_STR_SIZE, 256, typename bvector_type::allocator_type > plain_octet_matrix_type
const value_type * value() const
Get current position (value)
Serialize sparse vector into a memory buffer(s) structure.
long long difference_type
const_iterator begin() const
Provide const iterator access to container content.
size_type effective_size() const
size of sparse vector (may be different for RSC)
str_sparse_vector_type * str_sparse_vector_type_ptr
bvector_type_ptr construct_row(size_type row)
reference & operator=(const value_type *str)
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)
size_type size() const
return size of the vector
static void throw_range_error(const char *err_msg)
throw range error
Utilities for bit transposition (internal) (experimental!)
size_t bit_blocks
Number of bit blocks.
void set(size_type idx, const value_type *str)
set specified element with bounds checking and automatic resize
const_iterator & operator++()
Advance to the next available value.
str_sparse_vector< CharType, BV, MAX_STR_SIZE > str_sparse_vector_type
base_sparse_vector< CharType, BV, MAX_STR_SIZE > parent_type
void erase_column(size_type idx)
void resize_internal(size_type sz)
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)
bvector_type_const_ptr get_row(size_type i) const
Constant iterator designed to enumerate "ON" bits.
static bool remap_tosv(value_type *sv_str, size_type buf_size, const value_type *str, const plain_octet_matrix_type &octet_remap_matrix2)
optmode
Optimization mode Every next level means additional checks (better compression vs time) ...
static size_type max_str()
get maximum string length capacity
size_type effective_vector_max() const
get effective string length used in vector
sparse vector de-serializer
str_sparse_vector_type::value_type value_type
bool operator==(const reference &ref) const
bool empty() const
return true if vector is empty
bvector_type::size_type size_type
void swap(str_sparse_vector &str_sv) BMNOEXEPT
str_sparse_vector(str_sparse_vector< CharType, BV, MAX_STR_SIZE > &&str_sv) BMNOEXEPT
const value_type * operator*() const
Get current position (value)
bool valid() const
Returns true if iterator is at a valid position.
void calc_octet_stat(plain_octet_matrix_type &octet_matrix) const
void insert_value_no_null(size_type idx, const value_type *str)
insert value without checking boundaries or support of NULL
bm::heap_matrix< CharType, 1024, MAX_STR_SIZE, allocator_type > buffer_matrix_type
void insert_value(size_type idx, const value_type *str)
insert value without checking boundaries
size_t bv_count
Number of bit-vectors.
void set_null(size_type idx)
set NULL status for the specified element Vector is resized automatically
void set_octet(size_type pos, size_type octet_idx, unsigned char octet)
void swap(base_sparse_vector< CharType, BV, MAX_SIZE > &bsv) BMNOEXEPT
bmatrix_type bmatr_
bit-transposed matrix
Structure with statistical information about memory allocation footprint, serialization projection...
void add(const bv_statistics &st)
Sum data from another sttructure.
size_type effective_max_str() const
get effective string length used in vector
static bool remap_fromsv(value_type *str, size_type buf_size, const value_type *sv_str, const plain_octet_matrix_type &octet_remap_matrix1)
back_insert_iterator get_back_inserter()
Provide back insert iterator Back insert iterator implements buffered insertion, which is faster...
size_type pos() const
Current position (index) in the vector.
Const iterator to do quick traverse of the sparse vector.
size_type get(size_type idx, value_type *str, size_type buf_size) const
get specified element
void insert_null(size_type idx, bool not_null)
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.
size_type size_
array size
str_sparse_vector_type::size_type size_type
static void throw_bad_value(const char *err_msg)
throw domain error
back_insert_iterator & operator++(int)
noop