BitMagic-C++
|
sparse vector with runtime compression using bit transposition method More...
#include <bmsparsevec.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 traverse the sparse vector. More... | |
struct | is_remap_support |
struct | is_rsc_support |
class | reference |
Reference class to access elements via common [] operator. More... | |
struct | statistics |
Public Member Functions | |
void | swap (sparse_vector< Val, BV > &sv) BMNOEXEPT |
content exchange More... | |
void | set_allocator_pool (allocator_pool_type *pool_ptr) |
Set allocator pool for local (non-threaded) memory cyclic(lots of alloc-free ops) opertations. More... | |
Construction and assignment | |
| |
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... | |
sparse_vector (const sparse_vector< Val, BV > &sv) | |
sparse_vector< Val, BV > & | operator= (const sparse_vector< Val, BV > &sv) |
sparse_vector (sparse_vector< Val, BV > &&sv) BMNOEXEPT | |
sparse_vector< Val, BV > & | operator= (sparse_vector< Val, BV > &&sv) BMNOEXEPT |
~sparse_vector () BMNOEXEPT | |
Element access | |
reference | operator[] (size_type idx) |
Operator to get write access to an element More... | |
value_type | operator[] (size_type idx) const |
get specified element without bounds checking More... | |
value_type | at (size_type idx) const |
access specified element with bounds checking More... | |
value_type | get (size_type idx) const |
get specified element without bounds checking More... | |
void | set (size_type idx, value_type v) |
set specified element with bounds checking and automatic resize More... | |
void | inc (size_type idx) |
increment specified element by one More... | |
void | push_back (value_type v) |
push value back into vector More... | |
void | push_back_null (size_type count) |
push back specified amount of NULL values More... | |
void | insert (size_type idx, value_type v) |
insert specified element into container More... | |
void | erase (size_type idx) |
erase specified element from container More... | |
void | clear (size_type idx, bool set_null=false) |
clear specified element with bounds checking and automatic resize More... | |
Iterator access | |
const_iterator | begin () const |
Provide const iterator access to container content More... | |
const_iterator | end () const |
Provide const iterator access to the end More... | |
const_iterator | get_const_iterator (size_type idx) const |
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... | |
Loading of sparse vector from C-style array | |
| |
void | import (const value_type *arr, size_type arr_size, size_type offset=0) |
Import list of elements from a C-style array. More... | |
void | import_back (const value_type *arr, size_type arr_size) |
Import list of elements from a C-style array (pushed back) More... | |
Export content to C-style array | |
| |
size_type | decode (value_type *arr, size_type idx_from, size_type dec_size, bool zero_mem=true) const |
Bulk export list of elements to a C-style array. More... | |
size_type | gather (value_type *arr, const size_type *idx, size_type size, bm::sort_order sorted_idx) const |
Gather elements to a C-style array. More... | |
Clear | |
| |
void | clear () BMNOEXEPT |
resize to zero, free memory More... | |
sparse_vector< Val, BV > & | clear_range (size_type left, size_type right, bool set_null=false) |
clear range (assign bit 0 for all plains) More... | |
Size, etc | |
| |
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... | |
Comparison | |
| |
bool | equal (const sparse_vector< Val, BV > &sv, bm::null_support null_able=bm::use_null) const |
check if another sparse vector has the same content and size More... | |
Element comparison | |
| |
int | compare (size_type idx, const value_type val) const |
Compare vector element with argument. More... | |
Memory optimization | |
| |
void | optimize (bm::word_t *temp_block=0, typename bvector_type::optmode opt_mode=bvector_type::opt_compress, typename sparse_vector< Val, BV >::statistics *stat=0) |
run memory optimization for all vector plains More... | |
void | optimize_gap_size () |
Optimize sizes of GAP blocks. More... | |
void | calc_stat (struct sparse_vector< Val, BV >::statistics *st) const |
Calculates memory statistics. More... | |
Merge, split, partition data | |
| |
sparse_vector< Val, BV > & | join (const sparse_vector< Val, BV > &sv) |
join all with another sparse vector using OR operation More... | |
sparse_vector< Val, BV > & | merge (sparse_vector< Val, BV > &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. More... | |
void | copy_range (const sparse_vector< Val, BV > &sv, size_type left, size_type right) |
copy range of values from another sparse vector More... | |
void | filter (const bvector_type &bv_mask) |
Apply value filter, defined by mask vector. More... | |
![]() | |
base_sparse_vector () | |
base_sparse_vector (bm::null_support null_able, allocation_policy_type ap, size_type bv_max_size, const allocator_type &alloc) | |
base_sparse_vector (const base_sparse_vector< Val, BV, MAX_SIZE > &bsv) | |
base_sparse_vector (base_sparse_vector< Val, BV, MAX_SIZE > &&bsv) BMNOEXEPT | |
void | swap (base_sparse_vector< Val, BV, MAX_SIZE > &bsv) BMNOEXEPT |
size_type | size () const |
void | resize (size_type new_size) |
void | clear_range (size_type left, size_type right, bool set_null) |
void | clear () BMNOEXEPT |
resize to zero, free memory More... | |
bool | empty () const |
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 |
Calculates memory statistics. More... | |
bool | equal (const base_sparse_vector< Val, BV, MAX_SIZE > &sv, bm::null_support null_able=bm::use_null) const |
check if another sparse vector has the same content and size More... | |
bool | is_nullable () const |
check if container supports NULL(unassigned) values More... | |
const bvector_type * | get_null_bvector () const |
Get bit-vector of assigned values or NULL (if not constructed that way) More... | |
bool | is_null (size_type idx) const |
test if specified element is NULL More... | |
bvector_type_ptr | get_plain (unsigned i) |
get access to bit-plain, function checks and creates a plain More... | |
bvector_type_const_ptr | get_plain (unsigned i) const |
get read-only access to bit-plain More... | |
unsigned | effective_plains () const |
Number of effective bit-plains in the value type. More... | |
bvector_type_ptr | plain (unsigned i) |
get access to bit-plain as is (can return NULL) More... | |
const bvector_type_ptr | plain (unsigned i) const |
bvector_type * | get_null_bvect () |
void | free_plain (unsigned i) |
free memory in bit-plain More... | |
bm::id64_t | get_plains_mask (unsigned element_idx) const |
Data Fields | |
const typedef bvector_type * | bvector_type_const_ptr |
const typedef value_type & | const_reference |
friend | const_iterator |
friend | back_insert_iterator |
![]() | |
const typedef bvector_type * | bvector_type_const_ptr |
const typedef value_type & | const_reference |
Protected Types | |
enum | octet_plains { sv_octet_plains = sizeof(value_type) } |
Protected Member Functions | |
void | set_value (size_type idx, value_type v) |
set value without checking boundaries More... | |
void | set_value_no_null (size_type idx, value_type v) |
set value without checking boundaries or support of NULL More... | |
void | push_back_no_null (value_type v) |
push value back into vector without NULL semantics More... | |
void | insert_value (size_type idx, value_type v) |
insert value without checking boundaries More... | |
void | insert_value_no_null (size_type idx, value_type v) |
insert value without checking boundaries or support of NULL More... | |
void | resize_internal (size_type sz) |
size_type | size_internal () const |
bool | is_remap () const |
size_t | remap_size () const |
const unsigned char * | get_remap_buffer () const |
unsigned char * | init_remap_buffer () |
void | set_remap () |
![]() | |
void | copy_from (const base_sparse_vector< Val, BV, MAX_SIZE > &bsv) |
void | clear_value_plains_from (unsigned plain_idx, size_type idx) |
void | insert_clear_value_plains_from (unsigned plain_idx, size_type idx) |
void | erase_column (size_type idx) |
void | insert_null (size_type idx, bool not_null) |
Friends | |
template<class V , class SV > | |
class | rsc_sparse_vector |
template<class SVect > | |
class | sparse_vector_scanner |
template<class SVect > | |
class | sparse_vector_serializer |
template<class SVect > | |
class | sparse_vector_deserializer |
Various traits | |
void | set_null (size_type idx) |
set specified element to unassigned value (NULL) More... | |
static bool | is_compressed () |
trait if sparse vector is "compressed" (false) More... | |
Access to internals | |
void | sync (bool) |
syncronize internal structures More... | |
size_type | extract (value_type *arr, size_type size, size_type offset=0, bool zero_mem=true, allocator_pool_type *pool_ptr=0) const |
Bulk export list of elements to a C-style array. More... | |
size_type | extract_range (value_type *arr, size_type size, size_type offset, bool zero_mem=true) const |
extract small window without use of masking vector More... | |
size_type | extract_plains (value_type *arr, size_type size, size_type offset, bool zero_mem=true) const |
extract medium window without use of masking vector More... | |
size_type | effective_size () const |
size of sparse vector (may be different for RSC) More... | |
size_type | effective_vector_max () const |
Always 1 (non-matrix type) More... | |
static size_type | translate_address (size_type i) |
address translation for this type of container More... | |
static void | throw_range_error (const char *err_msg) |
throw range error More... | |
static void | throw_bad_alloc () |
throw bad alloc More... | |
static bool | find_rank (size_type rank, size_type &pos) |
find position of compressed element by its rank More... | |
Additional Inherited Members | |
![]() | |
static unsigned | plains () |
get total number of bit-plains in the vector More... | |
static unsigned | stored_plains () |
Number of stored bit-plains (value plains + extra. More... | |
![]() | |
static unsigned | value_bits () |
Number of total bit-plains in the value type. More... | |
static unsigned | null_plain () |
plain index for the "NOT NULL" flag1s plain More... | |
![]() | |
bmatrix_type | bmatr_ |
bit-transposed matrix More... | |
size_type | size_ |
array size More... | |
unsigned | effective_plains_ |
sparse vector with runtime compression using bit transposition method
Sparse vector implements variable bit-depth storage model. Initial data is bit-transposed into bit-planes so each element may use less memory than the original native data type prescribes. For example, 32-bit integer may only use 20 bits.
Another level of compression is provided by bit-vector (BV template parameter) used for storing bit planes. bvector<> implements varians of on the fly block compression, so if a significant area of a sparse vector uses less bits - it will save memory.
Overall it provides variable bit-depth compression, sparse compression in bit-plains.
Definition at line 81 of file bmsparsevec.h.
typedef bvector_type::allocation_policy bm::sparse_vector< Val, BV >::allocation_policy_type |
Definition at line 92 of file bmsparsevec.h.
typedef allocator_type::allocator_pool_type bm::sparse_vector< Val, BV >::allocator_pool_type |
Definition at line 94 of file bmsparsevec.h.
typedef BV::allocator_type bm::sparse_vector< Val, BV >::allocator_type |
Definition at line 91 of file bmsparsevec.h.
typedef bvector_type::block_idx_type bm::sparse_vector< Val, BV >::block_idx_type |
Definition at line 88 of file bmsparsevec.h.
typedef bm::basic_bmatrix<BV> bm::sparse_vector< Val, BV >::bmatrix_type |
Definition at line 95 of file bmsparsevec.h.
typedef bvector_type::enumerator bm::sparse_vector< Val, BV >::bvector_enumerator_type |
Definition at line 93 of file bmsparsevec.h.
typedef BV bm::sparse_vector< Val, BV >::bvector_type |
Definition at line 85 of file bmsparsevec.h.
typedef bvector_type* bm::sparse_vector< Val, BV >::bvector_type_ptr |
Definition at line 86 of file bmsparsevec.h.
typedef base_sparse_vector<Val, BV, 1> bm::sparse_vector< Val, BV >::parent_type |
Definition at line 96 of file bmsparsevec.h.
typedef bvector_type::size_type bm::sparse_vector< Val, BV >::size_type |
Definition at line 87 of file bmsparsevec.h.
typedef Val bm::sparse_vector< Val, BV >::value_type |
Definition at line 84 of file bmsparsevec.h.
|
protected |
Enumerator | |
---|---|
sv_octet_plains |
Definition at line 838 of file bmsparsevec.h.
bm::sparse_vector< Val, BV >::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 881 of file bmsparsevec.h.
bm::sparse_vector< Val, BV >::sparse_vector | ( | const sparse_vector< Val, BV > & | sv | ) |
copy-ctor
Definition at line 892 of file bmsparsevec.h.
bm::sparse_vector< Val, BV >::sparse_vector | ( | sparse_vector< Val, BV > && | sv | ) |
move-ctor
Definition at line 900 of file bmsparsevec.h.
bm::sparse_vector< Val, BV >::~sparse_vector |
Definition at line 911 of file bmsparsevec.h.
sparse_vector< Val, BV >::value_type bm::sparse_vector< Val, BV >::at | ( | size_type | idx | ) | const |
access specified element with bounds checking
idx | - element index |
Definition at line 1426 of file bmsparsevec.h.
Referenced by main(), and print_svector().
sparse_vector< Val, BV >::const_iterator bm::sparse_vector< Val, BV >::begin |
Provide const iterator access to container content
Definition at line 1910 of file bmsparsevec.h.
Referenced by build_vector_pairs(), and main().
void bm::sparse_vector< Val, BV >::calc_stat | ( | struct sparse_vector< Val, BV >::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 1702 of file bmsparsevec.h.
void bm::sparse_vector< Val, BV >::clear |
resize to zero, free memory
Definition at line 1671 of file bmsparsevec.h.
Referenced by bm::sparse_vector< unsigned, bm::bvector<> >::operator=().
void bm::sparse_vector< Val, BV >::clear | ( | size_type | idx, |
bool | set_null = false |
||
) |
clear specified element with bounds checking and automatic resize
idx | - element index |
set_null | - if true the value receives NULL (unassigned) value |
Definition at line 1472 of file bmsparsevec.h.
Referenced by main().
sparse_vector< Val, BV > & bm::sparse_vector< Val, BV >::clear_range | ( | size_type | left, |
size_type | right, | ||
bool | set_null = false |
||
) |
clear range (assign bit 0 for all plains)
left | - interval start |
right | - interval end (closed interval) |
set_null | - set cleared values to unassigned (NULL) |
Definition at line 1690 of file bmsparsevec.h.
int bm::sparse_vector< Val, BV >::compare | ( | size_type | idx, |
const value_type | val | ||
) | const |
Compare vector element with argument.
idx | - vactor element index |
val | - argument to compare with |
Definition at line 1890 of file bmsparsevec.h.
void bm::sparse_vector< Val, BV >::copy_range | ( | const sparse_vector< Val, BV > & | sv, |
size_type | left, | ||
size_type | right | ||
) |
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] |
Definition at line 1831 of file bmsparsevec.h.
sparse_vector< Val, BV >::size_type bm::sparse_vector< Val, BV >::decode | ( | value_type * | arr, |
size_type | idx_from, | ||
size_type | dec_size, | ||
bool | zero_mem = true |
||
) | const |
Bulk export list of elements to a C-style array.
For efficiency, this is left as a low level function, it does not do any bounds checking on the target array, it will override memory and crash if you are not careful with allocation and request size.
arr | - dest array |
idx_from | - index in the sparse vector to export from |
dec_size | - decoding size (array allocation should match) |
zero_mem | - set to false if target array is pre-initialized with 0s to avoid performance penalty |
Definition at line 1039 of file bmsparsevec.h.
Referenced by main().
|
inline |
size of sparse vector (may be different for RSC)
Definition at line 823 of file bmsparsevec.h.
|
inline |
Always 1 (non-matrix type)
Definition at line 828 of file bmsparsevec.h.
|
inline |
return true if vector is empty
Definition at line 618 of file bmsparsevec.h.
Referenced by bm::sparse_vector< Val, BV >::back_insert_iterator::flush(), main(), and run_benchmark().
|
inline |
Provide const iterator access to the end
Definition at line 472 of file bmsparsevec.h.
Referenced by build_vector_pairs(), and main().
bool bm::sparse_vector< Val, BV >::equal | ( | const sparse_vector< Val, BV > & | 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 plains |
Definition at line 1900 of file bmsparsevec.h.
Referenced by main().
void bm::sparse_vector< Val, BV >::erase | ( | size_type | idx | ) |
erase specified element from container
idx | - element index |
Definition at line 1569 of file bmsparsevec.h.
sparse_vector< Val, BV >::size_type bm::sparse_vector< Val, BV >::extract | ( | value_type * | arr, |
size_type | size, | ||
size_type | offset = 0 , |
||
bool | zero_mem = true , |
||
allocator_pool_type * | pool_ptr = 0 |
||
) | const |
Bulk export list of elements to a C-style array.
Use of all extract() methods is restricted. Please consider decode() for the same purpose.
arr | - dest array |
size | - dest size |
offset | - target index in the sparse vector to export from |
zero_mem | - set to false if target array is pre-initialized with 0s to avoid performance penalty |
Decoder functor
Definition at line 1337 of file bmsparsevec.h.
sparse_vector< Val, BV >::size_type bm::sparse_vector< Val, BV >::extract_plains | ( | value_type * | arr, |
size_type | size, | ||
size_type | offset, | ||
bool | zero_mem = true |
||
) | const |
extract medium window without use of masking vector
Definition at line 1292 of file bmsparsevec.h.
sparse_vector< Val, BV >::size_type bm::sparse_vector< Val, BV >::extract_range | ( | value_type * | arr, |
size_type | size, | ||
size_type | offset, | ||
bool | zero_mem = true |
||
) | const |
extract small window without use of masking vector
Definition at line 1212 of file bmsparsevec.h.
void bm::sparse_vector< Val, BV >::filter | ( | const bvector_type & | bv_mask | ) |
Apply value filter, defined by mask vector.
All bit-plains are ANDed against the filter mask.
Definition at line 1866 of file bmsparsevec.h.
|
static |
find position of compressed element by its rank
Definition at line 1679 of file bmsparsevec.h.
sparse_vector< Val, BV >::size_type bm::sparse_vector< Val, BV >::gather | ( | value_type * | arr, |
const size_type * | idx, | ||
size_type | size, | ||
bm::sort_order | sorted_idx | ||
) | const |
Gather elements to a C-style array.
Gather collects values from different locations, for best performance feed it with sorted list of indexes.
Faster than one-by-one random access.
For efficiency, this is left as a low level function, it does not do any bounds checking on the target array, it will override memory and crash if you are not careful with allocation and request size.
arr | - dest array |
idx | - index list to gather elements |
size | - decoding index list size (array allocation should match) |
sorted_idx | - sort order directive for the idx array (BM_UNSORTED, BM_SORTED, BM_UNKNOWN) Sort order affects both performance and correctness(!), use BM_UNKNOWN if not sure. |
Definition at line 1063 of file bmsparsevec.h.
sparse_vector< Val, BV >::value_type bm::sparse_vector< Val, BV >::get | ( | size_type | idx | ) | const |
get specified element without bounds checking
idx | - element index |
Definition at line 1437 of file bmsparsevec.h.
Referenced by counting_sort_naive(), sparse_vect_index::get_vector(), bm::sparse_vector< unsigned, bm::bvector<> >::operator[](), and print_sorted().
|
inline |
Provide back insert iterator Back insert iterator implements buffered insertion, which is faster, than random access or push_back.
Definition at line 483 of file bmsparsevec.h.
Referenced by generate_test_set().
|
inline |
Get const_itertor re-positioned to specific element.
idx | - position in the sparse vector |
Definition at line 477 of file bmsparsevec.h.
|
inlineprotected |
Definition at line 863 of file bmsparsevec.h.
void bm::sparse_vector< Val, BV >::import | ( | const value_type * | arr, |
size_type | arr_size, | ||
size_type | offset = 0 |
||
) |
Import list of elements from a C-style array.
arr | - source array |
arr_size | - source size |
offset | - target index in the sparse vector |
Definition at line 953 of file bmsparsevec.h.
Referenced by convert_bv2sv(), and main().
void bm::sparse_vector< Val, BV >::import_back | ( | const value_type * | arr, |
size_type | arr_size | ||
) |
Import list of elements from a C-style array (pushed back)
arr | - source array |
srr_size | - source size |
Definition at line 1029 of file bmsparsevec.h.
void bm::sparse_vector< Val, BV >::inc | ( | size_type | idx | ) |
increment specified element by one
idx | - element index |
Definition at line 1651 of file bmsparsevec.h.
Referenced by counting_sort(), counting_sort_parallel(), and counting_sort_subbatch().
|
inlineprotected |
Definition at line 864 of file bmsparsevec.h.
void bm::sparse_vector< Val, BV >::insert | ( | size_type | idx, |
value_type | v | ||
) |
insert specified element into container
idx | - element index |
v | - element value |
Definition at line 1511 of file bmsparsevec.h.
Referenced by insertion_sort().
|
protected |
insert value without checking boundaries
Definition at line 1525 of file bmsparsevec.h.
|
protected |
insert value without checking boundaries or support of NULL
Definition at line 1534 of file bmsparsevec.h.
|
inlinestatic |
trait if sparse vector is "compressed" (false)
Definition at line 499 of file bmsparsevec.h.
|
inlineprotected |
Definition at line 861 of file bmsparsevec.h.
sparse_vector< Val, BV > & bm::sparse_vector< Val, BV >::join | ( | const sparse_vector< Val, BV > & | sv | ) |
join all with another sparse vector using OR operation
sv | - argument vector to join with |
Definition at line 1754 of file bmsparsevec.h.
Referenced by main().
sparse_vector< Val, BV > & bm::sparse_vector< Val, BV >::merge | ( | sparse_vector< Val, BV > & | 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.
sv | - [in, out]argument vector to join with (vector mutates) |
Definition at line 1793 of file bmsparsevec.h.
Referenced by counting_sort_parallel().
|
inline |
copy assignmment operator
Definition at line 362 of file bmsparsevec.h.
|
inline |
move assignmment operator
Definition at line 375 of file bmsparsevec.h.
|
inline |
Operator to get write access to an element
Definition at line 395 of file bmsparsevec.h.
|
inline |
get specified element without bounds checking
idx | - element index |
Definition at line 402 of file bmsparsevec.h.
void bm::sparse_vector< Val, BV >::optimize | ( | bm::word_t * | temp_block = 0 , |
typename bvector_type::optmode | opt_mode = bvector_type::opt_compress , |
||
typename sparse_vector< Val, BV >::statistics * | stat = 0 |
||
) |
run memory optimization for all vector plains
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 1718 of file bmsparsevec.h.
Referenced by convert_bv2sv(), and main().
void bm::sparse_vector< Val, BV >::optimize_gap_size |
Optimize sizes of GAP blocks.
This method runs an analysis to find optimal GAP levels for all bit plains of the vector.
Definition at line 1737 of file bmsparsevec.h.
void bm::sparse_vector< Val, BV >::push_back | ( | value_type | v | ) |
push value back into vector
v | - element value |
Definition at line 1489 of file bmsparsevec.h.
Referenced by generate_random_subset(), and main().
|
protected |
push value back into vector without NULL semantics
Definition at line 1582 of file bmsparsevec.h.
void bm::sparse_vector< Val, BV >::push_back_null | ( | size_type | count | ) |
push back specified amount of NULL values
count | - number of NULLs to push back |
Definition at line 1498 of file bmsparsevec.h.
|
inlineprotected |
Definition at line 862 of file bmsparsevec.h.
|
inline |
resize vector
sz | - new size |
Definition at line 623 of file bmsparsevec.h.
Referenced by main(), and bm::sparse_vector< unsigned, bm::bvector<> >::resize_internal().
|
inlineprotected |
Definition at line 858 of file bmsparsevec.h.
void bm::sparse_vector< Val, BV >::set | ( | size_type | idx, |
value_type | v | ||
) |
set specified element with bounds checking and automatic resize
idx | - element index |
v | - element value |
Definition at line 1460 of file bmsparsevec.h.
Referenced by build_histogram(), convert_bv2sv(), counting_sort_naive(), load_snp_report(), and main().
void bm::sparse_vector< Val, BV >::set_allocator_pool | ( | allocator_pool_type * | pool_ptr | ) |
Set allocator pool for local (non-threaded) memory cyclic(lots of alloc-free ops) opertations.
Definition at line 1919 of file bmsparsevec.h.
Referenced by bm::sparse_vector< unsigned, bm::bvector<> >::set_allocator_pool().
void bm::sparse_vector< Val, BV >::set_null | ( | size_type | idx | ) |
set specified element to unassigned value (NULL)
idx | - element index |
Definition at line 945 of file bmsparsevec.h.
Referenced by main().
|
inlineprotected |
Definition at line 865 of file bmsparsevec.h.
|
protected |
set value without checking boundaries
Definition at line 1591 of file bmsparsevec.h.
|
protected |
set value without checking boundaries or support of NULL
Definition at line 1602 of file bmsparsevec.h.
|
inline |
return size of the vector
Definition at line 613 of file bmsparsevec.h.
Referenced by bm::sparse_vector< unsigned, bm::bvector<> >::copy_range(), bm::sparse_vector< unsigned, bm::bvector<> >::effective_size(), bm::sparse_vector< unsigned, bm::bvector<> >::empty(), bm::sparse_vector< unsigned, bm::bvector<> >::join(), main(), bm::sparse_vector< unsigned, bm::bvector<> >::merge(), print_svector(), and bm::sparse_vector< unsigned, bm::bvector<> >::size_internal().
|
inlineprotected |
Definition at line 859 of file bmsparsevec.h.
void bm::sparse_vector< Val, BV >::swap | ( | sparse_vector< Val, BV > & | sv | ) |
content exchange
Definition at line 917 of file bmsparsevec.h.
Referenced by bm::sparse_vector< unsigned, bm::bvector<> >::operator=().
|
inline |
syncronize internal structures
Definition at line 748 of file bmsparsevec.h.
|
static |
throw bad alloc
Definition at line 937 of file bmsparsevec.h.
|
static |
throw range error
Definition at line 925 of file bmsparsevec.h.
|
inlinestatic |
address translation for this type of container
Definition at line 797 of file bmsparsevec.h.
Definition at line 868 of file bmsparsevec.h.
|
friend |
Definition at line 871 of file bmsparsevec.h.
Definition at line 869 of file bmsparsevec.h.
Definition at line 870 of file bmsparsevec.h.
friend bm::sparse_vector< Val, BV >::back_insert_iterator |
Definition at line 330 of file bmsparsevec.h.
Referenced by generate_test_set(), and bm::sparse_vector< unsigned, bm::bvector<> >::get_back_inserter().
const typedef bvector_type* bm::sparse_vector< Val, BV >::bvector_type_const_ptr |
Definition at line 89 of file bmsparsevec.h.
friend bm::sparse_vector< Val, BV >::const_iterator |
Definition at line 329 of file bmsparsevec.h.
Referenced by build_vector_pairs(), bm::sparse_vector< unsigned, bm::bvector<> >::end(), bm::sparse_vector< unsigned, bm::bvector<> >::get_const_iterator(), and main().
const typedef value_type& bm::sparse_vector< Val, BV >::const_reference |
Definition at line 90 of file bmsparsevec.h.