BitMagic-C++
|
succinct sparse vector for strings with compression using bit-slicing ( transposition) method More...
#include <bmstrsparsevec.h>
Data Structures | |
class | back_insert_iterator |
Back insert iterator implements buffered insert, faster than generic access assignment. More... | |
class | const_iterator |
Const iterator to do quick traverse of the sparse vector. More... | |
class | const_reference |
Reference class to access elements via common [] operator. More... | |
struct | is_dynamic_splices |
struct | is_remap_support |
struct | is_rsc_support |
class | reference |
Reference class to access elements via common [] operator. More... | |
class | reference_base |
struct | statistics |
Public Types | |
enum | octet_slices { sv_octet_slices = STR_SIZE } |
typedef BV | bvector_type |
typedef bvector_type * | bvector_type_ptr |
typedef const bvector_type * | bvector_type_const_ptr |
typedef CharType | value_type |
typedef CharType * | value_type_prt |
typedef bvector_type::size_type | size_type |
typedef BV::allocator_type | allocator_type |
typedef bvector_type::allocation_policy | allocation_policy_type |
typedef bvector_type::enumerator | bvector_enumerator_type |
typedef allocator_type::allocator_pool_type | allocator_pool_type |
typedef bm::basic_bmatrix< BV > | bmatrix_type |
typedef base_sparse_vector< CharType, BV, STR_SIZE > | parent_type |
typedef parent_type::unsigned_value_type | unsigned_value_type |
typedef bm::dynamic_heap_matrix< unsigned char, allocator_type > | slice_octet_matrix_type |
Matrix of character remappings. More... | |
typedef slice_octet_matrix_type | remap_matrix_type |
typedef bm::dynamic_heap_matrix< size_t, allocator_type > | octet_freq_matrix_type |
Matrix of character frequencies (for optimal code remap) More... | |
Public Types inherited from bm::base_sparse_vector< CharType, BV, STR_SIZE > | |
enum | bit_planes |
enum | vector_capacity |
typedef CharType | value_type |
typedef BV | bvector_type |
typedef BV::size_type | size_type |
typedef bvector_type * | bvector_type_ptr |
typedef const bvector_type * | bvector_type_const_ptr |
typedef const value_type & | const_reference |
typedef BV::allocator_type | allocator_type |
typedef bvector_type::allocation_policy | allocation_policy_type |
typedef bvector_type::enumerator | bvector_enumerator_type |
typedef allocator_type::allocator_pool_type | allocator_pool_type |
typedef bm::basic_bmatrix< BV > | bmatrix_type |
typedef std::make_unsigned< value_type >::type | unsigned_value_type |
Public Member Functions | |
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. More... | |
str_sparse_vector (const str_sparse_vector &str_sv) | |
More... | |
str_sparse_vector (const str_sparse_vector &str_sv, bm::remap_setup remap_mode) | |
More... | |
str_sparse_vector< CharType, BV, STR_SIZE > & | operator= (const str_sparse_vector< CharType, BV, STR_SIZE > &str_sv) |
More... | |
str_sparse_vector (str_sparse_vector< CharType, BV, STR_SIZE > &&str_sv) BMNOEXCEPT | |
More... | |
str_sparse_vector< CharType, BV, STR_SIZE > & | operator= (str_sparse_vector< CharType, BV, STR_SIZE > &&str_sv) BMNOEXCEPT |
More... | |
void | sync (bool force) |
syncronize internal structures More... | |
bool | equal (const str_sparse_vector< CharType, BV, STR_SIZE > &sv, bm::null_support null_able=bm::use_null) const BMNOEXCEPT |
check if another sparse vector has the same content and size More... | |
size_type | effective_size () const BMNOEXCEPT |
size of sparse vector (may be different for RSC) More... | |
String element access | |
const const_reference | operator[] (size_type idx) const |
Operator to get read access to an element More... | |
reference | operator[] (size_type idx) |
Operator to get write access to an element More... | |
void | set (size_type idx, const value_type *str) |
set specified element with bounds checking and automatic resize More... | |
void | set_null (size_type idx) |
set NULL status for the specified element Vector is resized automatically More... | |
void | set_null (const bvector_type &bv_idx) |
Set NULL all elements set as 1 in the argument vector. More... | |
void | clear (const bvector_type &bv_idx) |
Set vector elements spcified by argument bit-vector to empty Note that set to empty elements are NOT going to tuned to NULL (NULL qualifier is preserved) More... | |
void | keep (const bvector_type &bv_idx) |
Set NULL all elements NOT set as 1 in the argument vector. More... | |
void | insert (size_type idx, const value_type *str) |
insert the specified element More... | |
template<typename StrType > | |
void | insert (size_type idx, const StrType &str) |
insert STL string More... | |
void | erase (size_type idx) |
erase the specified element More... | |
size_type | get (size_type idx, value_type *str, size_type buf_size) const BMNOEXCEPT |
get specified element More... | |
template<typename StrType > | |
void | assign (size_type idx, const StrType &str) |
set specified element with bounds checking and automatic resize More... | |
template<typename StrType > | |
void | push_back (const StrType &str) |
push back a string More... | |
void | push_back (const value_type *str) |
push back a string (zero terminated) More... | |
void | push_back_null (size_type count) |
push back specified amount of NULL values More... | |
void | push_back_null () |
push back NULL value More... | |
template<typename StrType > | |
bool | try_get (size_type idx, StrType &str) const |
get specified string element if NOT NULL Template method expects an STL-compatible type basic_string<> More... | |
template<typename StrType > | |
void | get (size_type idx, StrType &str) const |
get specified string element Template method expects an STL-compatible type basic_string<> More... | |
void | swap (str_sparse_vector &str_sv) BMNOEXCEPT |
More... | |
Element comparison functions <br> | |
int | compare (size_type idx, const value_type *str) const BMNOEXCEPT |
Compare vector element with argument lexicographically. More... | |
int | compare (size_type idx1, size_type idx2) const BMNOEXCEPT |
Compare two vector elements. More... | |
unsigned | common_prefix_length (size_type idx1, size_type idx2) const BMNOEXCEPT |
Find size of common prefix between two vector elements in octets. More... | |
int | compare_remap (size_type idx, const value_type *str) const BMNOEXCEPT |
Variant of compare for remapped vectors. More... | |
int | compare_nomap (size_type idx, const value_type *str) const BMNOEXCEPT |
Variant of compare for non-mapped vectors. More... | |
Clear <br> | |
void | clear_all (bool free_mem) BMNOEXCEPT |
resize to zero, free memory More... | |
void | clear () BMNOEXCEPT |
resize to zero, free memory More... | |
str_sparse_vector< CharType, BV, STR_SIZE > & | clear_range (size_type left, size_type right, bool set_null=false) |
clear range (assign bit 0 for all planes) More... | |
Memory optimization/compression <br> | |
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 More... | |
void | calc_stat (struct str_sparse_vector< CharType, BV, STR_SIZE >::statistics *st) const BMNOEXCEPT |
Calculates memory statistics. More... | |
void | freeze () |
Turn sparse vector into immutable mode Read-only (immutable) vector uses less memory and allows faster searches. More... | |
bool | is_ro () const BMNOEXCEPT |
Returns true if vector is read-only. More... | |
Iterator access | |
const_iterator | begin () const BMNOEXCEPT |
Provide const iterator access to container content More... | |
const_iterator | end () const BMNOEXCEPT |
Provide const iterator access to the end More... | |
const_iterator | get_const_iterator (size_type idx) const BMNOEXCEPT |
Get const_itertor re-positioned to specific element. More... | |
back_insert_iterator | get_back_inserter () |
Provide back insert iterator Back insert iterator implements buffered insertion, which is faster, than random access or push_back. More... | |
Export content to C-style <br> | |
template<typename CharMatrix > | |
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. More... | |
template<typename CharMatrix > | |
size_type | decode_substr (CharMatrix &cmatr, size_type idx_from, size_type dec_size, unsigned substr_from, unsigned substr_to, bool zero_mem=true) const |
Bulk export strings to a C-style matrix of chars. More... | |
template<typename CharMatrix > | |
void | import (CharMatrix &cmatr, size_type idx_from, size_type imp_size) |
Bulk import of strings from a C-style matrix of chars. More... | |
template<typename CharMatrix > | |
void | import_back (CharMatrix &cmatr, size_type imp_size) |
Bulk push-back import of strings from a C-style matrix of chars. More... | |
Merge, split, partition data <br> | |
void | copy_range (const str_sparse_vector< CharType, BV, STR_SIZE > &sv, size_type left, size_type right, bm::null_support slice_null=bm::use_null) |
copy range of values from another sparse vector More... | |
str_sparse_vector< CharType, BV, STR_SIZE > & | merge (str_sparse_vector< CharType, BV, STR_SIZE > &str_sv) |
merge with another sparse vector using OR operation Merge is different from join(), because it borrows data from the source vector, so it gets modified (destructive join) More... | |
void | keep_range (size_type left, size_type right, bm::null_support slice_null=bm::use_null) |
Keep only specified interval in the sparse vector, clear all other elements. More... | |
Public Member Functions inherited from bm::base_sparse_vector< CharType, BV, STR_SIZE > | |
base_sparse_vector () | |
base_sparse_vector (bm::null_support null_able, allocation_policy_type ap=allocation_policy_type(), size_type bv_max_size=bm::id_max, const allocator_type &alloc=allocator_type()) | |
base_sparse_vector (const base_sparse_vector< CharType, BV, MAX_SIZE > &bsv) | |
base_sparse_vector (base_sparse_vector< CharType, BV, MAX_SIZE > &&bsv) BMNOEXCEPT | |
More... | |
void | swap (base_sparse_vector< CharType, BV, MAX_SIZE > &bsv) BMNOEXCEPT |
size_type | size () const BMNOEXCEPT |
void | resize (size_type new_size, bool set_null) |
void | clear_range (size_type left, size_type right, bool set_null) |
void | keep_range_no_check (size_type left, size_type right, bm::null_support slice_null) |
void | clear_all (bool free_mem=true) BMNOEXCEPT |
resize to zero, free memory More... | |
bool | empty () const BMNOEXCEPT |
More... | |
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 More... | |
void | calc_stat (typename bvector_type::statistics *st) const BMNOEXCEPT |
Calculates memory statistics. More... | |
bool | equal (const base_sparse_vector< CharType, BV, MAX_SIZE > &sv, bm::null_support null_able=bm::use_null) const BMNOEXCEPT |
check if another sparse vector has the same content and size More... | |
bool | is_nullable () const BMNOEXCEPT |
check if container supports NULL(unassigned) values More... | |
bm::null_support | get_null_support () const BMNOEXCEPT |
check if container supports NULL (unassigned) values More... | |
const bvector_type * | get_null_bvector () const BMNOEXCEPT |
Get bit-vector of assigned values or NULL (if not constructed that way) More... | |
bool | is_null (size_type idx) const BMNOEXCEPT |
test if specified element is NULL More... | |
void | set_allocator_pool (allocator_pool_type *pool_ptr) BMNOEXCEPT |
Set allocation pool. More... | |
allocator_pool_type * | get_allocator_pool () const BMNOEXCEPT |
Get allocation pool. More... | |
bvector_type_ptr | get_create_slice (unsigned i) |
get access to bit-plain, function checks and creates a plane More... | |
bvector_type_const_ptr | get_slice (unsigned i) const BMNOEXCEPT |
get read-only access to bit-plane More... | |
unsigned | effective_slices () const BMNOEXCEPT |
Number of effective bit-planes in the value type. More... | |
bvector_type_ptr | slice (unsigned i) BMNOEXCEPT |
get access to bit-plane as is (can return NULL) More... | |
bvector_type_const_ptr | slice (unsigned i) const BMNOEXCEPT |
bvector_type * | get_null_bvect () BMNOEXCEPT |
void | free_slice (unsigned i) |
free memory in bit-plane More... | |
bm::id64_t | get_slice_mask (unsigned element_idx) const BMNOEXCEPT |
More... | |
const bmatrix_type & | get_bmatrix () const BMNOEXCEPT |
More... | |
bmatrix_type & | get_bmatrix () BMNOEXCEPT |
access to internal bit-matrix More... | |
void | mark_null_idx (unsigned null_idx) BMNOEXCEPT |
Set NULL plain index. More... | |
Static Public Member Functions | |
static bool | find_rank (size_type rank, size_type &pos) BMNOEXCEPT |
find position of compressed element by its rank More... | |
Various traits <br> | |
static constexpr bool | is_compressed () BMNOEXCEPT |
various type traits More... | |
static constexpr bool | is_str () BMNOEXCEPT |
Static Public Member Functions inherited from bm::base_sparse_vector< CharType, BV, STR_SIZE > | |
static constexpr bool | is_signed () BMNOEXCEPT |
returns true if value type is signed integral type More... | |
static unsigned | slices () BMNOEXCEPT |
get total number of bit-planes in the vector More... | |
static unsigned | stored_slices () BMNOEXCEPT |
Number of stored bit-planes (value planes + extra. More... | |
static unsigned_value_type | s2u (value_type v) BMNOEXCEPT |
Convert signed value type to unsigned representation. More... | |
static value_type | u2s (unsigned_value_type v) BMNOEXCEPT |
Convert unsigned value type to signed representation. More... | |
Protected Types | |
enum | insert_buf_size_e { ins_buf_size = bm::gap_max_bits } |
Protected Types inherited from bm::base_sparse_vector< CharType, BV, STR_SIZE > | |
typedef bvector_type::block_idx_type | block_idx_type |
Protected Member Functions | |
template<typename CharMatrix , size_t BufSize = ins_buf_size> | |
void | import_no_check (CharMatrix &cmatr, size_type idx_from, size_type imp_size, bool set_not_null=true) |
More... | |
template<size_t BufSize = ins_buf_size> | |
void | import_char_slice (const unsigned_value_type *ch_slice, unsigned ch_acc, size_type char_slice_idx, size_type idx_from, size_type imp_size) |
More... | |
void | set_value (size_type idx, const value_type *str) |
set value without checking boundaries More... | |
void | set_value_no_null (size_type idx, const value_type *str) |
set value without checking boundaries or support of NULL More... | |
void | insert_value (size_type idx, const value_type *str) |
insert value without checking boundaries More... | |
void | insert_value_no_null (size_type idx, const value_type *str) |
insert value without checking boundaries or support of NULL More... | |
size_type | size_internal () const |
More... | |
void | resize_internal (size_type sz) |
More... | |
size_t | remap_size () const |
More... | |
const unsigned char * | get_remap_buffer () const |
More... | |
unsigned char * | init_remap_buffer () |
More... | |
void | set_remap () |
More... | |
bool | resolve_range (size_type from, size_type to, size_type *idx_from, size_type *idx_to) const |
const remap_matrix_type * | get_remap_matrix () const |
More... | |
remap_matrix_type * | get_remap_matrix () |
More... | |
void | remap (back_insert_iterator &iit) |
reamp using statistics table from inserter More... | |
void | remap_from_impl (const str_sparse_vector &str_sv, octet_freq_matrix_type *omatrix, bool move_data) |
Remap from implementation, please note that move_data flag can violate cosnt-ness. More... | |
Protected Member Functions inherited from bm::base_sparse_vector< CharType, BV, STR_SIZE > | |
void | copy_from (const base_sparse_vector< CharType, BV, MAX_SIZE > &bsv) |
void | merge_matr (bmatrix_type &bmatr) |
Merge plane bvectors from an outside base matrix Note: outside base matrix gets destroyed. More... | |
void | freeze_matr () |
Turn on RO mode. More... | |
void | clear_value_planes_from (unsigned plane_idx, size_type idx) |
More... | |
void | insert_clear_value_planes_from (unsigned plane_idx, size_type idx) |
More... | |
void | erase_column (size_type idx, bool erase_null) |
More... | |
void | insert_null (size_type idx, bool not_null) |
More... | |
void | bit_sub_rows (const bvector_type &bv, bool use_null) |
Set SUB (MINUS) operation on all existing bit-slices. More... | |
void | bit_and_rows (const bvector_type &bv) |
Set AND (intersect) operation on all existing bit-slices. More... | |
void | optimize_block (block_idx_type nb, typename BV::optmode opt_mode) |
plane index for the "NOT NULL" flags plane More... | |
void | copy_range_slices (const base_sparse_vector< CharType, BV, MAX_SIZE > &bsv, typename base_sparse_vector< CharType, BV, MAX_SIZE >::size_type left, typename base_sparse_vector< CharType, BV, MAX_SIZE >::size_type right, bm::null_support slice_null) |
Perform copy_range() on a set of planes. More... | |
Static Protected Member Functions | |
Errors and exceptions <br> | |
static void | throw_range_error (const char *err_msg) |
throw range error More... | |
static void | throw_bad_value (const char *err_msg) |
throw domain error More... | |
Static Protected Member Functions inherited from bm::base_sparse_vector< CharType, BV, STR_SIZE > | |
static constexpr unsigned | value_bits () BMNOEXCEPT |
Number of total bit-planes in the value type. More... | |
Protected Attributes | |
unsigned | remap_flags_ |
remapping status More... | |
slice_octet_matrix_type | remap_matrix1_ |
octet remap table 1 More... | |
slice_octet_matrix_type | remap_matrix2_ |
octet remap table 2 More... | |
Protected Attributes inherited from bm::base_sparse_vector< CharType, BV, STR_SIZE > | |
bmatrix_type | bmatr_ |
bit-transposed matrix More... | |
unsigned_value_type | slice_mask_ |
slice presence bit-mask More... | |
size_type | size_ |
array size More... | |
unsigned | effective_slices_ |
number of bit slices actually allocated More... | |
bool | is_ro_ |
read-only More... | |
Friends | |
template<class SVect > | |
class | sparse_vector_serializer |
template<class SVect > | |
class | sparse_vector_deserializer |
Size, etc <br> | |
size_type | size () const |
return size of the vector More... | |
bool | empty () const |
return true if vector is empty More... | |
void | resize (size_type sz) |
resize vector More... | |
size_type | effective_max_str () const BMNOEXCEPT |
get effective string length used in vector Calculate and returns efficiency, how close are we to the reserved maximum. More... | |
size_type | effective_vector_max () const |
get effective string length used in vector More... | |
void | sync_size () BMNOEXCEPT |
recalculate size to exclude tail NULL elements After this call size() will return the true size of the vector More... | |
static size_type | max_str () |
get maximum string length capacity More... | |
Char remapping, succinct utilities | |
Remapping runs character usage analysis (frequency analysis) based on that implements reduction of dit-depth thus improves search performance and memory usage (both RAM and serialized). Remapping limits farther modifications of sparse vector. (Use remapped vector as read-only). | |
bool | is_remap () const BMNOEXCEPT |
Get character remapping status (true | false) More... | |
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 memory (both RAM and disk) but should not be modified (should be read-only). More... | |
void | remap () |
Build remapping profile and re-load content to save memory. More... | |
void | calc_octet_stat (octet_freq_matrix_type &octet_matrix) const |
More... | |
void | build_octet_remap (slice_octet_matrix_type &octet_remap_matrix1, slice_octet_matrix_type &octet_remap_matrix2, octet_freq_matrix_type &octet_occupancy_matrix) const |
More... | |
bool | remap_tosv (value_type *sv_str, size_type buf_size, const value_type *str) const BMNOEXCEPT |
More... | |
void | recalc_remap_matrix2 () |
More... | |
static bool | remap_tosv (value_type *BMRESTRICT sv_str, size_type buf_size, const value_type *BMRESTRICT str, const slice_octet_matrix_type &BMRESTRICT octet_remap_matrix2) BMNOEXCEPT |
More... | |
static bool | remap_fromsv (value_type *BMRESTRICT str, size_type buf_size, const value_type *BMRESTRICT sv_str, const slice_octet_matrix_type &BMRESTRICT octet_remap_matrix1) BMNOEXCEPT |
More... | |
succinct sparse vector for strings with compression using bit-slicing ( transposition) method
Initial string is bit-transposed into bit-slices so collection may use less memory due to prefix sum (GAP) compression in bit-slices. In addition, the container can use chracter re-mapping using char freaquencies to compute the minimal codes. Re-mapping can reduce memory footprint, get better search performance and improve storage compression.
Template parameters: CharType - type of character (char or unsigned char) (wchar not tested) BV - bit-vector for bit-slicing STR_SIZE - initial string size (can dynamically increase on usage)
Definition at line 71 of file bmstrsparsevec.h.
typedef bm::dynamic_heap_matrix<size_t, allocator_type> bm::str_sparse_vector< CharType, BV, STR_SIZE >::octet_freq_matrix_type |
Matrix of character frequencies (for optimal code remap)
Definition at line 108 of file bmstrsparsevec.h.
typedef bm::dynamic_heap_matrix<unsigned char, allocator_type> bm::str_sparse_vector< CharType, BV, STR_SIZE >::slice_octet_matrix_type |
Matrix of character remappings.
Definition at line 101 of file bmstrsparsevec.h.
|
protected |
Enumerator | |
---|---|
ins_buf_size |
Definition at line 1333 of file bmstrsparsevec.h.
enum bm::str_sparse_vector::octet_slices |
Enumerator | |
---|---|
sv_octet_slices |
Definition at line 92 of file bmstrsparsevec.h.
bm::str_sparse_vector< CharType, BV, STR_SIZE >::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.
null_able | - defines if vector supports NULL values flag by default it is OFF, use bm::use_null to enable it |
ap | - allocation strategy for underlying bit-vectors Default allocation policy uses BM_BIT setting (fastest access) |
bv_max_size | - maximum possible size of underlying bit-vectors Please note, this is NOT size of svector itself, it is dynamic upper limit which should be used very carefully if we surely know the ultimate size |
alloc | - allocator for bit-vectors |
Definition at line 1568 of file bmstrsparsevec.h.
bm::str_sparse_vector< CharType, BV, STR_SIZE >::str_sparse_vector | ( | const str_sparse_vector< CharType, BV, STR_SIZE > & | str_sv | ) |
copy-ctor
Definition at line 1584 of file bmstrsparsevec.h.
bm::str_sparse_vector< CharType, BV, STR_SIZE >::str_sparse_vector | ( | const str_sparse_vector< CharType, BV, STR_SIZE > & | str_sv, |
bm::remap_setup | remap_mode | ||
) |
construct empty sparse vector, copying the remap tables from another vector
str_sv | - source vector to take the remap tables from (assumed to be remaped) |
remap_mode | - remap table copy param |
Definition at line 1598 of file bmstrsparsevec.h.
References BM_ASSERT, bm::COPY_RTABLES, and bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_flags_.
|
inline |
move-ctor
Definition at line 523 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_flags_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix1_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix2_, and bm::base_sparse_vector< CharType, BV, STR_SIZE >::swap().
|
inline |
set specified element with bounds checking and automatic resize
This is an equivalent of set() method, but templetized to be more compatible with the STL std::string and the likes
idx | - element index (vector auto-resized if needs to) |
str | - input string expected an STL class with size() support, like basic_string<> or vector<char> |
Definition at line 640 of file bmstrsparsevec.h.
References BM_ASSERT, bm::base_sparse_vector< CharType, BV, STR_SIZE >::bmatr_, bm::base_sparse_vector< CharType, BV, STR_SIZE >::clear_value_planes_from(), bm::base_sparse_vector< CharType, BV, STR_SIZE >::get_null_bvect(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_flags_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix2_, bm::basic_bmatrix< BV >::set_octet(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::size(), and bm::base_sparse_vector< CharType, BV, STR_SIZE >::size_.
Referenced by main(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::push_back().
str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator bm::str_sparse_vector< CharType, BV, STR_SIZE >::begin |
Provide const iterator access to container content
Definition at line 2395 of file bmstrsparsevec.h.
Referenced by main().
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::build_octet_remap | ( | slice_octet_matrix_type & | octet_remap_matrix1, |
slice_octet_matrix_type & | octet_remap_matrix2, | ||
octet_freq_matrix_type & | octet_occupancy_matrix | ||
) | const |
Compute optimal remap codes
Definition at line 2042 of file bmstrsparsevec.h.
References BM_ASSERT, bm::find_first_nz(), and bm::find_max_nz().
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_from_impl().
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::calc_octet_stat | ( | octet_freq_matrix_type & | octet_matrix | ) | const |
Calculate flags which octets are present on each byte-plane.
Definition at line 2012 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::valid().
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_from_impl().
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::calc_stat | ( | struct str_sparse_vector< CharType, BV, STR_SIZE >::statistics * | st | ) | const |
Calculates memory statistics.
Function fills statistics structure containing information about how this vector uses memory and estimation of max. amount of memory bvector needs to serialize itself.
st | - pointer on statistics structure to be filled in. |
Definition at line 1812 of file bmstrsparsevec.h.
References bm::bv_statistics::bit_blocks, BM_ASSERT, bm::bv_statistics::bv_count, bm::bv_statistics::gap_blocks, bm::bv_statistics::gap_cap_overhead, bm::bv_statistics::max_serialize_mem, bm::bv_statistics::memory_used, and bm::bv_statistics::ptr_sub_blocks.
Referenced by main().
|
inline |
resize to zero, free memory
Definition at line 807 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::clear_all().
|
inline |
Set vector elements spcified by argument bit-vector to empty Note that set to empty elements are NOT going to tuned to NULL (NULL qualifier is preserved)
bv_idx | - index bit-vector for elements which to be set to 0 |
Definition at line 580 of file bmstrsparsevec.h.
References bm::base_sparse_vector< CharType, BV, STR_SIZE >::bit_sub_rows().
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::clear_all | ( | bool | free_mem | ) |
resize to zero, free memory
Definition at line 2405 of file bmstrsparsevec.h.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::clear().
|
inline |
clear range (assign bit 0 for all planes)
left | - interval start |
right | - interval end (closed interval) |
set_null | - set cleared values to unassigned (NULL) |
Definition at line 816 of file bmstrsparsevec.h.
References bm::base_sparse_vector< CharType, BV, STR_SIZE >::clear_range(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::set_null().
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::import(), main(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_from_impl().
unsigned bm::str_sparse_vector< CharType, BV, STR_SIZE >::common_prefix_length | ( | size_type | idx1, |
size_type | idx2 | ||
) | const |
Find size of common prefix between two vector elements in octets.
Definition at line 1965 of file bmstrsparsevec.h.
int bm::str_sparse_vector< CharType, BV, STR_SIZE >::compare | ( | size_type | idx, |
const value_type * | str | ||
) | const |
Compare vector element with argument lexicographically.
The function does not account for NULL values, NULL element is treated as an empty string
NOTE: for a re-mapped container, input string may have no correct remapping, in this case we have an ambiguity (we know it is not equal (0) but LT or GT?). Behavior is undefined.
idx | - vactor element index |
str | - argument to compare with |
Definition at line 1900 of file bmstrsparsevec.h.
References BM_ASSERT.
Referenced by main().
int bm::str_sparse_vector< CharType, BV, STR_SIZE >::compare | ( | size_type | idx1, |
size_type | idx2 | ||
) | const |
Compare two vector elements.
The function does not account for NULL values, NULL element is treated as an empty string
idx1 | - vactor element index 1 |
idx2 | - vactor element index 2 |
Definition at line 1913 of file bmstrsparsevec.h.
References BM_ASSERT.
int bm::str_sparse_vector< CharType, BV, STR_SIZE >::compare_nomap | ( | size_type | idx, |
const value_type * | str | ||
) | const |
Variant of compare for non-mapped vectors.
Caller MUST guarantee vector is not remapped.
Definition at line 1873 of file bmstrsparsevec.h.
int bm::str_sparse_vector< CharType, BV, STR_SIZE >::compare_remap | ( | size_type | idx, |
const value_type * | str | ||
) | const |
Variant of compare for remapped vectors.
Caller MUST guarantee vector is remapped.
Definition at line 1844 of file bmstrsparsevec.h.
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::copy_range | ( | const str_sparse_vector< CharType, BV, STR_SIZE > & | sv, |
size_type | left, | ||
size_type | right, | ||
bm::null_support | slice_null = bm::use_null |
||
) |
copy range of values from another sparse vector
Copy [left..right] values from the source vector, clear everything outside the range.
sv | - source vector |
left | - index from in losed diapason of [left..right] |
right | - index to in losed diapason of [left..right] |
slice_null | - "use_null" copy range for NULL vector or do not copy it |
Definition at line 2329 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_flags_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix1_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix2_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::size(), and bm::xor_swap().
|
inline |
Bulk export strings to a C-style matrix of chars.
cmatr | - dest matrix (bm::heap_matrix) |
idx_from | - index in the sparse vector to export from |
dec_size | - decoding size (matrix column allocation should match) |
zero_mem | - set to false if target array is pre-initialized with 0s to avoid performance penalty |
Definition at line 1064 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::decode_substr(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::effective_max_str().
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_from_impl().
|
inline |
Bulk export strings to a C-style matrix of chars.
cmatr | - dest matrix (bm::heap_matrix) |
idx_from | - index in the sparse vector to export from |
dec_size | - decoding size (matrix column allocation should match) |
substr_from | - sub-string position from |
substr_to | - sub-string position to |
zero_mem | - set to false if target array is pre-initialized with 0s to avoid performance penalty |
Decoder functor
< target array for reverse transpose
< bit-plane mask
< i
< SV read offset
Definition at line 1088 of file bmstrsparsevec.h.
References BM_ASSERT, bm::base_sparse_vector< CharType, BV, STR_SIZE >::bmatr_, BMNOEXCEPT, BMNOEXCEPT2, BMRESTRICT, bm::str_sparse_vector< CharType, BV, STR_SIZE >::end(), bm::for_each_bit_range_no_check(), bm::base_sparse_vector< CharType, BV, STR_SIZE >::get_null_bvector(), bm::basic_bmatrix< BV >::get_row(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_flags_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix1_, bm::basic_bmatrix< BV >::rows_not_null(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::size().
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::decode().
str_sparse_vector< CharType, BV, STR_SIZE >::size_type bm::str_sparse_vector< CharType, BV, STR_SIZE >::effective_max_str |
get effective string length used in vector Calculate and returns efficiency, how close are we to the reserved maximum.
Definition at line 2003 of file bmstrsparsevec.h.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_reference::const_reference(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::decode(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::effective_vector_max(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::reference::reference(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_from_impl().
|
inline |
size of sparse vector (may be different for RSC)
Definition at line 1330 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::size().
|
inline |
get effective string length used in vector
Definition at line 860 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::effective_max_str().
|
inline |
return true if vector is empty
Definition at line 838 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::size().
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::flush_impl(), main(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_from_impl().
|
inline |
Provide const iterator access to the end
Definition at line 922 of file bmstrsparsevec.h.
References bm::id_max.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::decode_substr(), and main().
bool bm::str_sparse_vector< CharType, BV, STR_SIZE >::equal | ( | const str_sparse_vector< CharType, BV, STR_SIZE > & | sv, |
bm::null_support | null_able = bm::use_null |
||
) | const |
check if another sparse vector has the same content and size
sv | - sparse vector for comparison |
null_able | - flag to consider NULL vector in comparison (default) or compare only value content planes |
Definition at line 2299 of file bmstrsparsevec.h.
Referenced by main().
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::erase | ( | size_type | idx | ) |
erase the specified element
idx | - element index |
Definition at line 1654 of file bmstrsparsevec.h.
References BM_ASSERT.
Referenced by main().
|
static |
find position of compressed element by its rank
Definition at line 1990 of file bmstrsparsevec.h.
References BM_ASSERT.
|
inline |
Turn sparse vector into immutable mode Read-only (immutable) vector uses less memory and allows faster searches.
Before freezing it is recommenede to call optimize() to get full memory saving effect
Definition at line 907 of file bmstrsparsevec.h.
References bm::base_sparse_vector< CharType, BV, STR_SIZE >::freeze_matr().
Referenced by main().
|
inline |
get specified string element Template method expects an STL-compatible type basic_string<>
idx | - element index (vector auto-resized if needs to) |
str | - string to get [out] |
Definition at line 718 of file bmstrsparsevec.h.
References BM_ASSERT, bm::base_sparse_vector< CharType, BV, STR_SIZE >::bmatr_, bm::basic_bmatrix< BV >::get_octet(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_flags_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix1_, and bm::str_sparse_vector< CharType, BV, STR_SIZE >::throw_bad_value().
str_sparse_vector< CharType, BV, STR_SIZE >::size_type bm::str_sparse_vector< CharType, BV, STR_SIZE >::get | ( | size_type | idx, |
value_type * | str, | ||
size_type | buf_size | ||
) | const |
get specified element
idx | - element index |
str | - string buffer |
buf_size | - string buffer size |
Definition at line 1776 of file bmstrsparsevec.h.
Referenced by check_sparse(), main(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::try_get().
|
inline |
Provide back insert iterator Back insert iterator implements buffered insertion, which is faster, than random access or push_back.
Definition at line 934 of file bmstrsparsevec.h.
Referenced by GenerateTestData(), and main().
|
inline |
Get const_itertor re-positioned to specific element.
idx | - position in the sparse vector |
Definition at line 927 of file bmstrsparsevec.h.
|
inlineprotected |
Definition at line 1519 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix1_.
|
inlineprotected |
Definition at line 1538 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix1_.
|
inlineprotected |
Definition at line 1536 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix1_.
|
inline |
Bulk import of strings from a C-style matrix of chars.
cmatr | - source matrix (bm::heap_matrix) [in/out] parameter gets modified(corrupted) in the process |
idx_from | - destination index in the sparse vector |
imp_size | - import size (number or rows to import) |
Definition at line 1228 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::clear_range(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::import_no_check(), and bm::base_sparse_vector< CharType, BV, STR_SIZE >::size_.
|
inline |
Bulk push-back import of strings from a C-style matrix of chars.
cmatr | - source matrix (bm::heap_matrix) [in/out] parameter gets modified(corrupted) in the process |
imp_size | - import size (number or rows to import) |
Definition at line 1249 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::import_no_check(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::size().
|
inlineprotected |
full buffer import can use loop unrolling
Definition at line 1426 of file bmstrsparsevec.h.
References bm::bit_list(), BM_ASSERT, bm::base_sparse_vector< CharType, BV, STR_SIZE >::get_create_slice(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::ins_buf_size, and bm::word_bitcount().
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::import_no_check().
|
inlineprotected |
full buffer import can use loop unrolling
Definition at line 1340 of file bmstrsparsevec.h.
References bm::basic_bmatrix< BV >::allocate_rows(), BM_ASSERT, bm::base_sparse_vector< CharType, BV, STR_SIZE >::bmatr_, bm::base_sparse_vector< CharType, BV, STR_SIZE >::get_null_bvect(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::import_char_slice(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::ins_buf_size, bm::base_sparse_vector< CharType, BV, STR_SIZE >::is_nullable(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_flags_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix2_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::size(), and bm::base_sparse_vector< CharType, BV, STR_SIZE >::size_.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::import(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::import_back().
|
inlineprotected |
Definition at line 1521 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix1_.
|
inline |
insert STL string
idx | - element index (vector auto-resized if needs to) |
str | - STL string to set |
Definition at line 605 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::insert().
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::insert | ( | size_type | idx, |
const value_type * | str | ||
) |
insert the specified element
idx | - element index (vector auto-resized if needs to) |
str | - string to set (zero terminated) |
Definition at line 1638 of file bmstrsparsevec.h.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::insert(), insertion_sort(), and main().
|
protected |
insert value without checking boundaries
Definition at line 1734 of file bmstrsparsevec.h.
|
protected |
insert value without checking boundaries or support of NULL
Definition at line 1744 of file bmstrsparsevec.h.
References BM_ASSERT.
|
inlinestaticconstexpr |
various type traits
Definition at line 948 of file bmstrsparsevec.h.
|
inline |
Get character remapping status (true | false)
Definition at line 971 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_flags_.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_from_impl().
|
inline |
Returns true if vector is read-only.
Definition at line 910 of file bmstrsparsevec.h.
References bm::base_sparse_vector< CharType, BV, STR_SIZE >::is_ro_.
Referenced by main().
|
inline |
Set NULL all elements NOT set as 1 in the argument vector.
bv_idx | - index bit-vector for elements which needs to be kept |
Definition at line 588 of file bmstrsparsevec.h.
References bm::base_sparse_vector< CharType, BV, STR_SIZE >::bit_and_rows().
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::keep_range | ( | size_type | left, |
size_type | right, | ||
bm::null_support | slice_null = bm::use_null |
||
) |
Keep only specified interval in the sparse vector, clear all other elements.
left | - interval start |
right | - interval end (closed interval) |
slice_null | - "use_null" copy range for NULL vector or not |
Definition at line 2382 of file bmstrsparsevec.h.
References bm::xor_swap().
|
inlinestatic |
get maximum string length capacity
Definition at line 848 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::sv_octet_slices.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::set_substr().
str_sparse_vector< CharType, BV, STR_SIZE > & bm::str_sparse_vector< CharType, BV, STR_SIZE >::merge | ( | str_sparse_vector< CharType, BV, STR_SIZE > & | str_sv | ) |
merge with another sparse vector using OR operation Merge is different from join(), because it borrows data from the source vector, so it gets modified (destructive join)
tr_sv | - [in, out]argument vector to join with (vector mutates) |
Definition at line 2350 of file bmstrsparsevec.h.
References bm::base_sparse_vector< Val, BV, MAX_SIZE >::bmatr_, bm::base_sparse_vector< Val, BV, MAX_SIZE >::is_nullable(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_flags_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix1_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix2_, and bm::str_sparse_vector< CharType, BV, STR_SIZE >::size().
|
inline |
copy assignmment operator
Definition at line 511 of file bmstrsparsevec.h.
References bm::base_sparse_vector< CharType, BV, STR_SIZE >::copy_from(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_flags_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix1_, and bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix2_.
|
inline |
move assignmment operator
Definition at line 532 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::swap().
|
inline |
Operator to get write access to an element
Definition at line 552 of file bmstrsparsevec.h.
|
inline |
Operator to get read access to an element
Definition at line 548 of file bmstrsparsevec.h.
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::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
temp_block | - pre-allocated memory block to avoid unnecessary re-allocs |
opt_mode | - requested compression depth |
stat | - memory allocation statistics after optimization |
Definition at line 1797 of file bmstrsparsevec.h.
References bm::bv_statistics::add().
Referenced by main().
|
inline |
push back a string
str | - string to set (STL class with size() support, like basic_string) |
Definition at line 675 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::assign(), and bm::base_sparse_vector< CharType, BV, STR_SIZE >::size_.
Referenced by main().
|
inline |
push back a string (zero terminated)
str | - string to set |
Definition at line 681 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::set(), and bm::base_sparse_vector< CharType, BV, STR_SIZE >::size_.
|
inline |
push back NULL value
Definition at line 692 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::push_back_null().
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::push_back_null().
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::push_back_null | ( | size_type | count | ) |
push back specified amount of NULL values
count | - number of NULLs to push back |
Definition at line 1676 of file bmstrsparsevec.h.
References BM_ASSERT, and bm::id_max.
Referenced by main().
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::recalc_remap_matrix2 |
re-calculate remap matrix2 based on matrix1
Definition at line 2084 of file bmstrsparsevec.h.
References BM_ASSERT.
void bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::remap |
Build remapping profile and re-load content to save memory.
Definition at line 2167 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_from_impl(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::swap().
Referenced by main().
|
protected |
reamp using statistics table from inserter
Definition at line 2178 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::omatrix_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::remap_flags_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_from_impl(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::swap().
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_from | ( | const str_sparse_vector< CharType, BV, STR_SIZE > & | str_sv, |
octet_freq_matrix_type * | omatrix = 0 |
||
) |
Build remapping profile and load content from another sparse vector Remapped vector likely saves memory (both RAM and disk) but should not be modified (should be read-only).
str_sv | - source sparse vector (assumed it is not remapped) |
omatrix | - pointer to externall computed char freaquency matrix (optional) \so remap, freeze |
Definition at line 2196 of file bmstrsparsevec.h.
Referenced by main().
|
protected |
Remap from implementation, please note that move_data flag can violate cosnt-ness.
Definition at line 2207 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::build_octet_remap(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::calc_octet_stat(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::clear_range(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::decode(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::effective_max_str(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::empty(), bm::base_sparse_vector< Val, BV, MAX_SIZE >::get_bmatrix(), bm::base_sparse_vector< Val, BV, MAX_SIZE >::get_null_bvector(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::is_remap(), and bm::basic_bmatrix< BV >::rows().
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap().
|
static |
remap string from internal code to external (ASCII) system
Definition at line 2140 of file bmstrsparsevec.h.
|
inlineprotected |
Definition at line 1518 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix1_.
|
static |
remap string from external (ASCII) system to matrix internal code
Definition at line 2114 of file bmstrsparsevec.h.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_tosv().
|
inline |
remap string from external (ASCII) system to matrix internal code
Definition at line 1021 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix2_, and bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_tosv().
|
inline |
resize vector
sz | - new size |
Definition at line 843 of file bmstrsparsevec.h.
References bm::base_sparse_vector< CharType, BV, STR_SIZE >::resize().
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::add_value(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::resize_internal().
|
inlineprotected |
Definition at line 1516 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::resize().
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::set | ( | size_type | idx, |
const value_type * | str | ||
) |
set specified element with bounds checking and automatic resize
idx | - element index (vector auto-resized if needs to) |
str | - string to set (zero terminated) |
Definition at line 1627 of file bmstrsparsevec.h.
Referenced by main(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::push_back().
|
inline |
Set NULL all elements set as 1 in the argument vector.
bv_idx | - index bit-vector for elements which needs to be turned to NULL |
Definition at line 572 of file bmstrsparsevec.h.
References bm::base_sparse_vector< CharType, BV, STR_SIZE >::bit_sub_rows().
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::set_null | ( | size_type | idx | ) |
set NULL status for the specified element Vector is resized automatically
idx | - element index (vector auto-resized if needs to) |
Definition at line 1666 of file bmstrsparsevec.h.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::clear_range(), and main().
|
inlineprotected |
Definition at line 1526 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_flags_.
|
protected |
set value without checking boundaries
Definition at line 1688 of file bmstrsparsevec.h.
|
protected |
set value without checking boundaries or support of NULL
Definition at line 1699 of file bmstrsparsevec.h.
References BM_ASSERT.
|
inline |
return size of the vector
Definition at line 833 of file bmstrsparsevec.h.
References bm::base_sparse_vector< CharType, BV, STR_SIZE >::size_.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::assign(), check_sparse(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::copy_range(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::decode_substr(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::effective_size(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::empty(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::import_back(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::import_no_check(), main(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::merge(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::size_internal().
|
inlineprotected |
Definition at line 1515 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::size().
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::swap | ( | str_sparse_vector< CharType, BV, STR_SIZE > & | str_sv | ) |
Swap content
Definition at line 1615 of file bmstrsparsevec.h.
References bm::xor_swap().
Referenced by main(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::operator=(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap().
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::sync | ( | bool | force | ) |
syncronize internal structures
Definition at line 2290 of file bmstrsparsevec.h.
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::sync_size |
recalculate size to exclude tail NULL elements After this call size() will return the true size of the vector
Definition at line 2836 of file bmstrsparsevec.h.
References bm::base_sparse_vector< CharType, BV, STR_SIZE >::get_null_bvector(), and bm::base_sparse_vector< CharType, BV, STR_SIZE >::size_.
|
staticprotected |
throw domain error
Definition at line 2427 of file bmstrsparsevec.h.
References BM_ASSERT_THROW.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::get().
|
staticprotected |
|
inline |
get specified string element if NOT NULL Template method expects an STL-compatible type basic_string<>
idx | - element index (vector auto-resized if needs to) |
str | - string to get [out] |
Definition at line 702 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::get(), and bm::base_sparse_vector< CharType, BV, STR_SIZE >::is_null().
Referenced by main().
|
protected |
remapping status
Definition at line 1558 of file bmstrsparsevec.h.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::add_remap_stat(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::add_value(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::assign(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::copy_range(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::decode_substr(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::flush(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::get(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::import_no_check(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::is_remap(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::merge(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::operator=(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::set_remap(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::str_sparse_vector().
|
protected |
octet remap table 1
Definition at line 1559 of file bmstrsparsevec.h.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::copy_range(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::decode_substr(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::get(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::get_remap_buffer(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::get_remap_matrix(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::init_remap_buffer(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::merge(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::operator=(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_size(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::str_sparse_vector().
|
protected |
octet remap table 2
Definition at line 1560 of file bmstrsparsevec.h.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::assign(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::copy_range(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::import_no_check(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::merge(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::operator=(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_tosv(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::str_sparse_vector().