A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/classbm_1_1str__sparse__vector.html below:

NCBI C++ ToolKit: bm::str_sparse_vector< CharType, BV, STR_SIZE

Search Toolkit Book for bm::str_sparse_vector

succinct sparse vector for strings with compression using bit-slicing ( transposition) method More...

#include <util/bitset/bmstrsparsevec.h>

  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)     str_sparse_vector (const str_sparse_vector &str_sv, bm::remap_setup remap_mode)   str_sparse_vector< CharType, BV, STR_SIZE > &  operator= (const str_sparse_vector< CharType, BV, STR_SIZE > &str_sv)     str_sparse_vector (str_sparse_vector< CharType, BV, STR_SIZE > &&str_sv) noexcept   str_sparse_vector< CharType, BV, STR_SIZE > &  operator= (str_sparse_vector< CharType, BV, STR_SIZE > &&str_sv) noexcept   void  sync (bool force, bool sync_size)   syncronize internal structures More...
  bool  equal (const str_sparse_vector< CharType, BV, STR_SIZE > &sv, bm::null_support null_able=bm::use_null) const noexcept   check if another sparse vector has the same content and size More...
  size_type  effective_size () const noexcept   size of sparse vector (may be different for RSC) More...
  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...
  void  swap (size_type idx1, size_type idx2)   swap two vector elements between each other 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 noexcept   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) noexcept   void  clear_all (bool free_mem, unsigned remap=0) noexcept   resize to zero, free memory More...
  void  clear () noexcept   resize to zero, free memory, reset remapping 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...
  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 noexcept   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 noexcept   Returns true if vector is read-only. More...
  const_iterator  begin () const noexcept   Provide const iterator access to container content. More...
  const_iterator  end () const noexcept   Provide const iterator access to the end. More...
  const_iterator  get_const_iterator (size_type idx) const noexcept   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...
  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...
  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...
    base_sparse_vector ()     base_sparse_vector (bm::null_support null_able, bool is_dynamic, 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) noexcept   void  swap (base_sparse_vector< CharType, BV, MAX_SIZE > &bsv) noexcept   size_type  size () const noexcept   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) noexcept   resize to zero, free memory More...
  bool  empty () const noexcept   void  swap_elements (size_type idx1, size_type idx2)   swap two vector elements 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 noexcept   Calculates memory statistics. More...
  bool  equal (const base_sparse_vector< CharType, BV, MAX_SIZE > &sv, bm::null_support null_able=bm::use_null) const noexcept   check if another sparse vector has the same content and size More...
  bool  is_nullable () const noexcept   check if container supports NULL(unassigned) values More...
  bm::null_support  get_null_support () const noexcept   check if container supports NULL (unassigned) values More...
  const bvector_typeget_null_bvector () const noexcept   Get bit-vector of assigned values or NULL (if not constructed that way) More...
  bool  is_null (size_type idx) const noexcept   test if specified element is NULL More...
  void  set_allocator_pool (allocator_pool_type *pool_ptr) noexcept   Set allocation pool. More...
  allocator_pool_typeget_allocator_pool () const noexcept   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 noexcept   get read-only access to bit-plane More...
  unsigned  effective_slices () const noexcept   Number of effective bit-planes in the value type. More...
  bvector_type_ptr  slice (unsigned i) noexcept   get access to bit-plane as is (can return NULL) More...
  bvector_type_const_ptr  slice (unsigned i) const noexcept   bvector_typeget_null_bvect () noexcept   void  free_slice (unsigned i)   free memory in bit-plane More...
  bm::id64_t  get_slice_mask (unsigned element_idx) const noexcept   const bmatrix_typeget_bmatrix () const noexcept   bmatrix_typeget_bmatrix () noexcept   access to internal bit-matrix More...
  void  mark_null_idx (unsigned null_idx) noexcept   Set NULL plain index. More...
  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)   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)   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   void  resize_internal (size_type sz)   size_t  remap_size () const   const unsigned char *  get_remap_buffer () const   unsigned char *  init_remap_buffer ()   void  set_remap ()   bool  resolve_range (size_type from, size_type to, size_type *idx_from, size_type *idx_to) const   const remap_matrix_typeget_remap_matrix () const   remap_matrix_typeget_remap_matrix ()   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...
  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)   void  insert_clear_value_planes_from (unsigned plane_idx, size_type idx)   void  erase_column (size_type idx, bool erase_null)   void  insert_null (size_type idx, bool not_null)   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  sync_ro () noexcept   Sybc read-only state. 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...
  void  set_ro_flag (bool b) noexcept   Force RO flag without running freeze ops on content. More...
 

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 noexcept   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   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   bool  remap_tosv (value_type *sv_str, size_type buf_size, const value_type *str) const noexcept   bool  remap_n_tosv_2way (value_type *sv_str, value_type *str_cp, size_type buf_size, const value_type *str, size_t in_len) const noexcept   void  recalc_remap_matrix2 ()   static bool  remap_tosv (value_type *sv_str, size_type buf_size, const value_type *str, const slice_octet_matrix_type &octet_remap_matrix2) noexcept   static bool  remap_n_tosv_2way (value_type *sv_str, value_type *str_cp, size_type buf_size, const value_type *str, size_t in_len, const slice_octet_matrix_type &octet_remap_matrix2) noexcept   static bool  remap_fromsv (value_type *str, size_type buf_size, const value_type *sv_str, const slice_octet_matrix_type &octet_remap_matrix1) noexcept   template<typename CharType, typename BV, unsigned STR_SIZE>
class bm::str_sparse_vector< CharType, BV, STR_SIZE >

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.

◆ allocation_policy_type

template<typename CharType , typename BV , unsigned STR_SIZE>

Definition at line 81 of file bmstrsparsevec.h.

◆ allocator_pool_type

template<typename CharType , typename BV , unsigned STR_SIZE>

Definition at line 83 of file bmstrsparsevec.h.

◆ allocator_type

template<typename CharType , typename BV , unsigned STR_SIZE>

Definition at line 80 of file bmstrsparsevec.h.

◆ bmatrix_type

template<typename CharType , typename BV , unsigned STR_SIZE>

Definition at line 84 of file bmstrsparsevec.h.

◆ bvector_enumerator_type

template<typename CharType , typename BV , unsigned STR_SIZE>

Definition at line 82 of file bmstrsparsevec.h.

◆ bvector_type

template<typename CharType , typename BV , unsigned STR_SIZE>

Definition at line 74 of file bmstrsparsevec.h.

◆ bvector_type_const_ptr

template<typename CharType , typename BV , unsigned STR_SIZE>

Definition at line 76 of file bmstrsparsevec.h.

◆ bvector_type_ptr

template<typename CharType , typename BV , unsigned STR_SIZE>

Definition at line 75 of file bmstrsparsevec.h.

◆ octet_freq_matrix_type

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ parent_type

template<typename CharType , typename BV , unsigned STR_SIZE>

Definition at line 85 of file bmstrsparsevec.h.

◆ remap_matrix_type

template<typename CharType , typename BV , unsigned STR_SIZE>

Definition at line 102 of file bmstrsparsevec.h.

◆ size_type

template<typename CharType , typename BV , unsigned STR_SIZE>

Definition at line 79 of file bmstrsparsevec.h.

◆ slice_octet_matrix_type

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ unsigned_value_type

template<typename CharType , typename BV , unsigned STR_SIZE>

Definition at line 86 of file bmstrsparsevec.h.

◆ value_type

template<typename CharType , typename BV , unsigned STR_SIZE>

Definition at line 77 of file bmstrsparsevec.h.

◆ value_type_prt

template<typename CharType , typename BV , unsigned STR_SIZE>

Definition at line 78 of file bmstrsparsevec.h.

◆ insert_buf_size_e

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ octet_slices

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ str_sparse_vector() [1/4]

template<class CharType , class BV , unsigned STR_SIZE>

Sparse vector constructor.

Parameters
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
See also
bvector<>
bm::bvector<>::allocation_policy
bm::startegy

Definition at line 1608 of file bmstrsparsevec.h.

◆ str_sparse_vector() [2/4]

template<class CharType , class BV , unsigned STR_SIZE>

◆ str_sparse_vector() [3/4]

template<class CharType , class BV , unsigned STR_SIZE>

◆ str_sparse_vector() [4/4]

template<typename CharType , typename BV , unsigned STR_SIZE>

move-ctor

Definition at line 524 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::base_sparse_vector< CharType, BV, STR_SIZE >::swap(), and bm::dynamic_heap_matrix< Val, BVAlloc >::swap().

◆ assign()

template<typename CharType , typename BV , unsigned STR_SIZE>

template<typename StrType >

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

Parameters
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 649 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::dynamic_heap_matrix< Val, BVAlloc >::get(), bm::base_sparse_vector< CharType, BV, STR_SIZE >::get_null_bvect(), i, 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(), bm::base_sparse_vector< CharType, BV, STR_SIZE >::size_, and str().

Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::push_back(), and TestStrSparseVector().

◆ begin()

template<class CharType , class BV , unsigned STR_SIZE>

◆ build_octet_remap()

template<class CharType , class BV , unsigned STR_SIZE>

Compute optimal remap codes

Definition at line 2204 of file bmstrsparsevec.h.

References BM_ASSERT, bm::dynamic_heap_matrix< Val, BVAlloc >::cols(), bm::find_first_nz(), bm::find_max_nz(), i, bm::dynamic_heap_matrix< Val, BVAlloc >::resize(), bm::dynamic_heap_matrix< Val, BVAlloc >::row(), bm::dynamic_heap_matrix< Val, BVAlloc >::rows(), and bm::dynamic_heap_matrix< Val, BVAlloc >::set_zero().

Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_from_impl(), and TestStrSparseVector().

◆ calc_octet_stat()

template<class CharType , class BV , unsigned STR_SIZE>

Calculate flags which octets are present on each byte-plane.

Definition at line 2174 of file bmstrsparsevec.h.

References i, bm::dynamic_heap_matrix< Val, BVAlloc >::resize(), row, bm::dynamic_heap_matrix< Val, BVAlloc >::row(), bm::dynamic_heap_matrix< Val, BVAlloc >::set_zero(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::valid().

Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_from_impl(), and TestStrSparseVector().

◆ calc_stat()

template<class CharType , class BV , unsigned STR_SIZE>

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.

Parameters
st - pointer on statistics structure to be filled in.
See also
statistics

Definition at line 1864 of file bmstrsparsevec.h.

References BM_ASSERT, and st().

Referenced by TestStrSparseVector().

◆ clear() [1/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ clear() [2/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ clear_all()

template<class CharType , class BV , unsigned STR_SIZE>

resize to zero, free memory

Parameters
free_mem - true - free all bit-vectors memory, false - set bit-vecor to zero (memory remains reserved) remap - 0 - set to no-remap (default), 1 - keep remap substitution matrix for possible re-use (if remap() was ever called on this vector with the datawith same frequency profiles) Note that feeding the data with disimilar frequency profile would cause undefined behavior.
See also
remap

Definition at line 2601 of file bmstrsparsevec.h.

Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::clear().

◆ clear_range()

template<typename CharType , typename BV , unsigned STR_SIZE>

clear range (assign bit 0 for all planes)

Parameters
left - interval start right - interval end (closed interval) set_null - set cleared values to unassigned (NULL)

Definition at line 841 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(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_from_impl(), and TestStrSparseVector().

◆ common_prefix_length()

template<class CharType , class BV , unsigned STR_SIZE>

template<bool USE_PREFIX_BUF>

Find size of common prefix between two vector elements in octets.

Parameters
prefix_buf - optional param for keeping the common prefix string (without remap decode)
Returns
size of common prefix

Definition at line 2119 of file bmstrsparsevec.h.

References BM_ASSERT, ch1, ch2, and i.

Referenced by StressTestStrSparseVector().

◆ compare() [1/2]

template<class CharType , class BV , unsigned STR_SIZE>

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.

Parameters
idx - vactor element index str - argument to compare with
Returns
0 - equal, < 0 - vect[idx] < str, >0 otherwise

Definition at line 2052 of file bmstrsparsevec.h.

References BM_ASSERT, and str().

Referenced by CompareStrSparseVector(), quicksort2(), StressTestStrSparseVector(), TestStrSparseVector(), and TestStrSparseVectorSerial().

◆ compare() [2/2]

template<class CharType , class BV , unsigned STR_SIZE>

Compare two vector elements.

The function does not account for NULL values, NULL element is treated as an empty string

Parameters
idx1 - vactor element index 1 idx2 - vactor element index 2
Returns
0 - equal, < 0 - vect[idx1] < vect[idx2], >0 otherwise

Definition at line 2065 of file bmstrsparsevec.h.

References BM_ASSERT, i, and ncbi::grid::netcache::search::fields::size.

◆ compare_nomap()

template<class CharType , class BV , unsigned STR_SIZE>

◆ compare_remap()

template<class CharType , class BV , unsigned STR_SIZE>

◆ compare_str() [1/2]

template<class CharType , class BV , unsigned STR_SIZE>

◆ compare_str() [2/2]

template<class CharType , class BV , unsigned STR_SIZE>

◆ copy_range()

template<class CharType , class BV , unsigned STR_SIZE>

copy range of values from another sparse vector

Copy [left..right] values from the source vector, clear everything outside the range.

Parameters
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 2525 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_, pythonpp::resize(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::size(), and bm::xor_swap().

Referenced by TestStrSparseVector(), and TestStrSparseVectorSerial().

◆ decode()

template<typename CharType , typename BV , unsigned STR_SIZE>

template<typename CharMatrix >

◆ decode_substr()

template<typename CharType , typename BV , unsigned STR_SIZE>

template<typename CharMatrix >

Bulk export strings to a C-style matrix of chars.

Parameters
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
Returns
number of actually exported elements (can be less than requested)

Definition at line 1144 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(), i, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_flags_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix1_, bm::dynamic_heap_matrix< Val, BVAlloc >::remapz(), bm::basic_bmatrix< BV >::rows_not_null(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::size(), and str().

Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::decode(), and TestStrSparseVector().

◆ effective_max_str()

template<class CharType , class BV , unsigned STR_SIZE>

get effective string length used in vector Calculate and returns efficiency, how close are we to the reserved maximum.

Returns
current string length maximum

Definition at line 2165 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(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_from_impl(), and TestStrSparseVector().

◆ effective_size()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ effective_vector_max()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ empty()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ end()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ equal()

template<class CharType , class BV , unsigned STR_SIZE>

◆ erase()

template<class CharType , class BV , unsigned STR_SIZE>

◆ find_rank()

template<class CharType , class BV , unsigned STR_SIZE>

◆ freeze()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ get() [1/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

template<typename StrType >

get specified string element Template method expects an STL-compatible type basic_string<>

Parameters
idx - element index (vector auto-resized if needs to) str - string to get [out]

Definition at line 727 of file bmstrsparsevec.h.

References BM_ASSERT, bm::base_sparse_vector< CharType, BV, STR_SIZE >::bmatr_, bm::basic_bmatrix< BV >::get_octet(), i, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_flags_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_matrix1_, bm::dynamic_heap_matrix< Val, BVAlloc >::row(), str(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::throw_bad_value().

◆ get() [2/2]

template<class CharType , class BV , unsigned STR_SIZE>

get specified element

Parameters
idx - element index str - string buffer buf_size - string buffer size
Returns
string length

Definition at line 1828 of file bmstrsparsevec.h.

References i, and str().

Referenced by CompareStrSparseVector(), EraseStrCollection(), quicksort2(), StressTestStrSparseVector(), TestStrSparseSort(), TestStrSparseVector(), TestStrSparseVectorSerial(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::try_get().

◆ get_back_inserter()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ get_const_iterator()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ get_remap_buffer()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ get_remap_matrix() [1/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ get_remap_matrix() [2/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ import()

template<typename CharType , typename BV , unsigned STR_SIZE>

template<typename CharMatrix >

◆ import_back()

template<typename CharType , typename BV , unsigned STR_SIZE>

template<typename CharMatrix >

◆ import_char_slice()

template<typename CharType , typename BV , unsigned STR_SIZE>

template<size_t BufSize = ins_buf_size>

Definition at line 1466 of file bmstrsparsevec.h.

References bm::bit_list(), BM_ASSERT, ch0, bm::base_sparse_vector< CharType, BV, STR_SIZE >::get_create_slice(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::ins_buf_size, mask, and bm::word_bitcount().

Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::import_no_check().

◆ import_no_check()

template<typename CharType , typename BV , unsigned STR_SIZE>

template<typename CharMatrix , size_t BufSize = ins_buf_size>

Definition at line 1380 of file bmstrsparsevec.h.

References bm::basic_bmatrix< BV >::allocate_rows(), BM_ASSERT, bm::base_sparse_vector< CharType, BV, STR_SIZE >::bmatr_, ch0, ch1, ch2, ch3, bm::dynamic_heap_matrix< Val, BVAlloc >::get(), bm::base_sparse_vector< CharType, BV, STR_SIZE >::get_null_bvect(), i, 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(), bm::base_sparse_vector< CharType, BV, STR_SIZE >::size_, and str().

Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::import(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::import_back().

◆ init_remap_buffer()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ insert() [1/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

template<typename StrType >

◆ insert() [2/2]

template<class CharType , class BV , unsigned STR_SIZE>

◆ insert_value()

template<class CharType , class BV , unsigned STR_SIZE>

◆ insert_value_no_null()

template<class CharType , class BV , unsigned STR_SIZE>

◆ is_compressed()

template<typename CharType , typename BV , unsigned STR_SIZE>

inlinestaticconstexprnoexcept ◆ is_remap()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ is_ro()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ is_str()

template<typename CharType , typename BV , unsigned STR_SIZE>

inlinestaticconstexprnoexcept

Definition at line 976 of file bmstrsparsevec.h.

◆ keep()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ keep_range()

template<class CharType , class BV , unsigned STR_SIZE>

Keep only specified interval in the sparse vector, clear all other elements.

Parameters
left - interval start right - interval end (closed interval) slice_null - "use_null" copy range for NULL vector or not

Definition at line 2578 of file bmstrsparsevec.h.

References bm::xor_swap().

Referenced by TestStrSparseVector().

◆ max_str()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ merge()

template<class CharType , class BV , unsigned STR_SIZE>

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)

Parameters
tr_sv - [in, out]argument vector to join with (vector mutates)
Returns
self reference

Definition at line 2546 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_, pythonpp::resize(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::size().

Referenced by TestStrSparseVector().

◆ operator=() [1/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

copy assignmment operator

Definition at line 512 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_.

◆ operator=() [2/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ operator[]() [1/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ operator[]() [2/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ optimize()

template<class CharType , class BV , unsigned STR_SIZE>

◆ push_back() [1/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

template<typename StrType >

push back a string

Parameters
str - string to set (STL class with size() support, like basic_string)

Definition at line 684 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 StressTestStrSparseVector(), TestSparseFindEqStrPipeline(), TestStrSparseSort(), TestStrSparseVector(), and TestStrSparseVectorAlgo().

◆ push_back() [2/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ push_back_null() [1/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ push_back_null() [2/2]

template<class CharType , class BV , unsigned STR_SIZE>

◆ recalc_remap_matrix2()

template<class CharType , class BV , unsigned STR_SIZE>

◆ remap() [1/2]

template<class CharType , class BV , unsigned MAX_STR_SIZE>

◆ remap() [2/2]

template<class CharType , class BV , unsigned MAX_STR_SIZE>

reamp using statistics table from inserter

Definition at line 2372 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(), bm::dynamic_heap_matrix< Val, BVAlloc >::rows(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::swap().

◆ remap_from()

template<class CharType , class BV , unsigned STR_SIZE>

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).

Parameters
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 2390 of file bmstrsparsevec.h.

Referenced by StressTestStrSparseVector(), TestStrSparseVector(), and TestStrSparseVectorSerial().

◆ remap_from_impl()

template<class CharType , class BV , unsigned STR_SIZE>

Remap from implementation, please note that move_data flag can violate cosnt-ness.

Definition at line 2401 of file bmstrsparsevec.h.

References bm::alloc_pool_guard< POOL, PCLASS >::assign_if_not_set(), 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(), i, bm::str_sparse_vector< CharType, BV, STR_SIZE >::is_remap(), r(), and bm::basic_bmatrix< BV >::rows().

Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap().

◆ remap_fromsv()

template<class CharType , class BV , unsigned MAX_STR_SIZE>

remap string from internal code to external (ASCII) system

Returns
true if remapping was ok, false if found incorrect value for the plane

Definition at line 2334 of file bmstrsparsevec.h.

References i, and str().

Referenced by TestStrSparseVector().

◆ remap_n_tosv_2way() [1/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ remap_n_tosv_2way() [2/2]

template<class CharType , class BV , unsigned STR_SIZE>

◆ remap_size()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ remap_tosv() [1/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ remap_tosv() [2/2]

template<class CharType , class BV , unsigned STR_SIZE>

◆ resize()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ resize_internal()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ resolve_range()

template<typename CharType , typename BV , unsigned STR_SIZE>

Definition at line 1570 of file bmstrsparsevec.h.

◆ set()

template<class CharType , class BV , unsigned STR_SIZE>

◆ set_null() [1/2]

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ set_null() [2/2]

template<class CharType , class BV , unsigned STR_SIZE>

◆ set_remap()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ set_value()

template<class CharType , class BV , unsigned STR_SIZE>

◆ set_value_no_null()

template<class CharType , class BV , unsigned STR_SIZE>

◆ size()

template<typename CharType , typename BV , unsigned STR_SIZE>

return size of the vector

Returns
size of sparse vector

Definition at line 858 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(), CompareStrSparseVector(), 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(), EraseStrCollection(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::import_back(), 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 >::size_internal(), StressTestStrSparseVector(), TestStrSparseQuickSort(), TestStrSparseSort(), TestStrSparseVector(), and TestStrSparseVectorSerial().

◆ size_internal()

template<typename CharType , typename BV , unsigned STR_SIZE>

◆ swap() [1/2]

template<class CharType , class BV , unsigned STR_SIZE>

◆ swap() [2/2]

template<class CharType , class BV , unsigned STR_SIZE>

◆ sync()

template<class CharType , class BV , unsigned STR_SIZE>

◆ sync_size()

template<class CharType , class BV , unsigned STR_SIZE>

◆ throw_bad_value()

template<class CharType , class BV , unsigned STR_SIZE>

◆ throw_range_error()

template<class CharType , class BV , unsigned STR_SIZE>

◆ try_get()

template<typename CharType , typename BV , unsigned STR_SIZE>

template<typename StrType >

◆ sparse_vector_deserializer

template<typename CharType , typename BV , unsigned STR_SIZE>

template<class SVect >

Definition at line 1595 of file bmstrsparsevec.h.

◆ sparse_vector_serializer

template<typename CharType , typename BV , unsigned STR_SIZE>

template<class SVect >

Definition at line 1594 of file bmstrsparsevec.h.

◆ remap_flags_

template<typename CharType , typename BV , unsigned STR_SIZE>

remapping status

Definition at line 1598 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().

◆ remap_matrix1_

template<typename CharType , typename BV , unsigned STR_SIZE>

octet remap table 1

Definition at line 1599 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().

◆ remap_matrix2_

template<typename CharType , typename BV , unsigned STR_SIZE>

octet remap table 2

Definition at line 1600 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_n_tosv_2way(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_tosv(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::str_sparse_vector().

The documentation for this class was generated from the following file:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4