NCBI C++ ToolKit
|
Search Toolkit Book for bm::sparse_vector_deserializer
sparse vector de-serializer More...
#include <util/bitset/bmsparsevec_serial.h>
Public Types | |
typedef SV::bvector_type | bvector_type |
typedef const bvector_type * | bvector_type_const_ptr |
typedef bvector_type * | bvector_type_ptr |
typedef SV::value_type | value_type |
typedef SV::size_type | size_type |
typedef bvector_type::allocator_type::allocator_pool_type | allocator_pool_type |
typedef bm::serializer< bvector_type >::bv_ref_vector_type | bv_ref_vector_type |
Public Member Functions | |
sparse_vector_deserializer () | |
~sparse_vector_deserializer () | |
void | set_finalization (bm::finalization is_final) |
Set deserialization finalization to force deserialized vectors into READONLY (or READWRITE) mode. More... | |
void | set_xor_ref (bv_ref_vector_type *bv_ref_ptr) |
Set external XOR reference vectors (data frame referenece vectors) More... | |
void | deserialize (SV &sv, const unsigned char *buf, bool clear_sv=true) |
void | deserialize_range (SV &sv, const unsigned char *buf, size_type from, size_type to, bool clear_sv=true) |
void | deserialize (SV &sv, const unsigned char *buf, size_type from, size_type to) |
void | deserialize (SV &sv, const unsigned char *buf, const bvector_type &mask_bv) |
void | deserialize_structure (SV &sv, const unsigned char *buf) |
Protected Types | |
typedef bvector_type::allocator_type | alloc_type |
Protected Member Functions | |
unsigned | load_header (bm::decoder &dec, SV &sv, unsigned char &matr_s_ser) |
Deserialize header/version and other common info. More... | |
void | deserialize_sv (SV &sv, const unsigned char *buf, const bvector_type *mask_bv, bool clear_sv) |
void | deserialize_planes (SV &sv, unsigned planes, const unsigned char *buf, const bvector_type *mask_bv=0) |
deserialize bit-vector planes More... | |
void | load_planes_off_table (const unsigned char *buf, bm::decoder &dec, unsigned planes) |
load offset table More... | |
int | load_null_plane (SV &sv, int planes, const unsigned char *buf, const bvector_type *mask_bv) |
load NULL bit-plane (returns new planes count) More... | |
void | load_remap (SV &sv, const unsigned char *remap_buf_ptr) |
load string remap dict More... | |
void | setup_xor_compression () |
setup deserializers More... | |
void | clear_xor_compression () |
unset XOR compression vectors More... | |
Static Protected Member Functions | |
static void | raise_invalid_header () |
throw error on incorrect deserialization More... | |
static void | raise_invalid_64bit () |
throw error on incorrect deserialization More... | |
static void | raise_invalid_bitdepth () |
throw error on incorrect deserialization More... | |
static void | raise_invalid_format () |
throw error on incorrect deserialization More... | |
static void | raise_missing_remap_matrix () |
throw error on incorrect deserialization More... | |
Protected Attributes | |
bm::finalization | is_final_ = bm::finalization::UNDEFINED |
const unsigned char * | remap_buf_ptr_ = 0 |
alloc_type | alloc_ |
bm::word_t * | temp_block_ = 0 |
allocator_pool_type | pool_ |
bvector_type | plane_digest_bv_ |
bm::id64_t | sv_size_ |
bm::id64_t | digest_offset_ |
bm::deserializer< bvector_type, bm::decoder > | deserial_ |
bm::operation_deserializer< bvector_type > | op_deserial_ |
bm::rank_compressor< bvector_type > | rsc_compressor_ |
bvector_type | not_null_mask_bv_ |
bvector_type | rsc_mask_bv_ |
bm::heap_vector< size_t, alloc_type, true > | off_vect_ |
bm::heap_vector< unsigned, alloc_type, true > | off32_vect_ |
rlen_vector_type | remap_rlen_vect_ |
bv_ref_vector_type | bv_ref_ |
reference vector More... | |
bv_ref_vector_type * | bv_ref_ptr_ = 0 |
external ref bit-vect More... | |
bool | idx_range_set_ = false |
size_type | idx_range_from_ |
size_type | idx_range_to_ |
Private Types | |
typedef bm::heap_vector< unsigned, alloc_type, true > | rlen_vector_type |
Private Member Functions | |
sparse_vector_deserializer (const sparse_vector_deserializer &)=delete | |
sparse_vector_deserializer & | operator= (const sparse_vector_deserializer &)=delete |
sparse vector de-serializer
Definition at line 326 of file bmsparsevec_serial.h.
|
protected |
Definition at line 427 of file bmsparsevec_serial.h.
typedef bvector_type::allocator_type::allocator_pool_type bm::sparse_vector_deserializer< SV >::allocator_pool_type |
Definition at line 334 of file bmsparsevec_serial.h.
typedef bm::serializer<bvector_type>::bv_ref_vector_type bm::sparse_vector_deserializer< SV >::bv_ref_vector_type |
Definition at line 335 of file bmsparsevec_serial.h.
typedef SV::bvector_type bm::sparse_vector_deserializer< SV >::bvector_type |
Definition at line 329 of file bmsparsevec_serial.h.
typedef const bvector_type* bm::sparse_vector_deserializer< SV >::bvector_type_const_ptr |
Definition at line 330 of file bmsparsevec_serial.h.
typedef bvector_type* bm::sparse_vector_deserializer< SV >::bvector_type_ptr |
Definition at line 331 of file bmsparsevec_serial.h.
|
private |
Definition at line 478 of file bmsparsevec_serial.h.
typedef SV::size_type bm::sparse_vector_deserializer< SV >::size_type |
Definition at line 333 of file bmsparsevec_serial.h.
typedef SV::value_type bm::sparse_vector_deserializer< SV >::value_type |
Definition at line 332 of file bmsparsevec_serial.h.
bm::sparse_vector_deserializer< SV >::sparse_vector_deserializer |
Definition at line 1156 of file bmsparsevec_serial.h.
bm::sparse_vector_deserializer< SV >::~sparse_vector_deserializer |
Definition at line 1166 of file bmsparsevec_serial.h.
|
privatedelete |
|
protected |
unset XOR compression vectors
Definition at line 1195 of file bmsparsevec_serial.h.
void bm::sparse_vector_deserializer< SV >::deserialize | ( | SV & | sv, |
const unsigned char * | buf, | ||
bool | clear_sv = true |
||
) |
Deserialize sparse vector
sv | - [out] target sparse vector to populate |
buf | - input BLOB source memory pointer |
clear_sv | - if true clears the target vector (sv) |
Definition at line 1222 of file bmsparsevec_serial.h.
References BM_ASSERT, and buf.
Referenced by CSeqDictionary< Alphabet >::Deserialize(), CDataFrame< MAX_SIZE >::Deserialize(), NVcfUtil::DeserializeColumn(), CVcfHistogram::Init(), bm::sparse_vector_deserialize(), test_chr21(), TestCompressSparseVectorSerial(), TestSignedSparseVectorSerial(), TestSparseVectorSerial(), TestSparseVectorSerialization2(), TestStrSparseVector_FindEq(), TestStrSparseVectorSerial(), CVCFVariantsBase::x_DeserializeDescr_All(), CVCFVariantsBase::x_DeserializeDescr_Range(), and CVCFVariantsBase::x_DeserializeIndexVectors().
|
inline |
Deserialize sparse vector using address mask vector Address mask defines (by set bits) which vector elements to be extracted from the compressed BLOB
sv | - [out] target sparse vector to populate |
buf | - source memory pointer |
mask_bv | - AND mask bit-vector (address gather vector) |
Definition at line 409 of file bmsparsevec_serial.h.
|
inline |
Better use deserialize_range()
Definition at line 392 of file bmsparsevec_serial.h.
|
protected |
deserialize bit-vector planes
Definition at line 1472 of file bmsparsevec_serial.h.
References BM_ASSERT, buf, i, offset, and bm::READONLY.
void bm::sparse_vector_deserializer< SV >::deserialize_range | ( | SV & | sv, |
const unsigned char * | buf, | ||
size_type | from, | ||
size_type | to, | ||
bool | clear_sv = true |
||
) |
Deserialize sparse vector for the range [from, to]
sv | - [out] target sparse vector to populate |
buf | - input BLOB source memory pointer |
from | - start vector index for deserialization range |
to | - end vector index for deserialization range |
clear_sv | - if true clears the target vector |
Definition at line 1261 of file bmsparsevec_serial.h.
References buf.
Referenced by bm::sparse_vector_deserializer< bm::str_sparse_vector >::deserialize(), TestCompressSparseVectorSerial(), TestSparseVectorSerialization2(), TestStrSparseVectorSerial(), and CVCFVariantsBase::x_DeserializeDescr_Range().
void bm::sparse_vector_deserializer< SV >::deserialize_structure | ( | SV & | sv, |
const unsigned char * | buf | ||
) |
Load serialization descriptor, create vectors but DO NOT perform full deserialization
sv | - [out] target sparse vector to populate |
buf | - source memory pointer |
Definition at line 1235 of file bmsparsevec_serial.h.
References BM_ASSERT, buf, and i.
Referenced by test_chr21(), test_str_sv_des_fnc(), TestSparseVectorSerialization2(), TestStrSparseVectorSerial(), VCF_des_test(), CVCFVariantsBase::x_DeserializeDescr_All(), and CVCFVariantsBase::x_DeserializeDescr_Range().
|
protected |
Definition at line 1333 of file bmsparsevec_serial.h.
References BM_ASSERT, and buf.
Referenced by bm::sparse_vector_deserializer< bm::str_sparse_vector >::deserialize().
|
protected |
Deserialize header/version and other common info.
Definition at line 1417 of file bmsparsevec_serial.h.
References BM_ASSERT, bm::decoder::get_64(), bm::decoder_base::get_8(), and rapidjson::value.
|
protected |
load NULL bit-plane (returns new planes count)
Definition at line 1559 of file bmsparsevec_serial.h.
References BM_ASSERT, buf, i, offset, and bm::READONLY.
|
protected |
load offset table
Definition at line 1631 of file bmsparsevec_serial.h.
References bm::bit_in< TDecoder >::bic_decode_u32_cm(), BM_ASSERT, buf, bm::decoder::get_32(), bm::decoder::get_64(), bm::decoder_base::get_8(), i, and offset.
|
protected |
load string remap dict
Definition at line 1703 of file bmsparsevec_serial.h.
References BM_ASSERT, BMRESTRICT, cnt, bm::bit_in< TDecoder >::gamma(), bm::decoder::get_16(), bm::decoder::get_32(), bm::decoder::get_64(), bm::decoder_base::get_8(), bm::decoder_base::memcpy(), r(), and row.
|
privatedelete |
|
staticprotected |
throw error on incorrect deserialization
Definition at line 1808 of file bmsparsevec_serial.h.
|
staticprotected |
throw error on incorrect deserialization
Definition at line 1820 of file bmsparsevec_serial.h.
|
staticprotected |
throw error on incorrect deserialization
Definition at line 1832 of file bmsparsevec_serial.h.
|
staticprotected |
throw error on incorrect deserialization
Definition at line 1796 of file bmsparsevec_serial.h.
|
staticprotected |
throw error on incorrect deserialization
Definition at line 1844 of file bmsparsevec_serial.h.
void bm::sparse_vector_deserializer< SV >::set_finalization | ( | bm::finalization | is_final | ) |
Set deserialization finalization to force deserialized vectors into READONLY (or READWRITE) mode.
Performance impact: Turning ON finalization will make deserialization a lit slower, because each bit-vector will be re-converted into new mode (READONLY). Following (search) operations may perform a bit faster.
is_final | - finalization code (use bm::finalization::READONLY to produce an immutable vector) |
Definition at line 1176 of file bmsparsevec_serial.h.
Referenced by TestCompressSparseVectorSerial(), TestSparseVectorSerial(), and TestStrSparseVectorSerial().
void bm::sparse_vector_deserializer< SV >::set_xor_ref | ( | bv_ref_vector_type * | bv_ref_ptr | ) |
Set external XOR reference vectors (data frame referenece vectors)
bv_ref_ptr | - external reference vector if NULL - resets the use of reference |
Definition at line 1185 of file bmsparsevec_serial.h.
Referenced by test_chr21(), TestSparseVectorSerialization2(), TestStrSparseVectorSerial(), CVCFVariantsBase::x_DeserializeDescr_All(), and CVCFVariantsBase::x_DeserializeDescr_Range().
|
protected |
setup deserializers
Definition at line 1205 of file bmsparsevec_serial.h.
|
protected |
Definition at line 483 of file bmsparsevec_serial.h.
|
protected |
reference vector
Definition at line 501 of file bmsparsevec_serial.h.
|
protected |
external ref bit-vect
Definition at line 502 of file bmsparsevec_serial.h.
|
protected |
Definition at line 491 of file bmsparsevec_serial.h.
|
protected |
Definition at line 489 of file bmsparsevec_serial.h.
|
protected |
Definition at line 506 of file bmsparsevec_serial.h.
|
protected |
Definition at line 505 of file bmsparsevec_serial.h.
Referenced by bm::sparse_vector_deserializer< bm::str_sparse_vector >::deserialize().
|
protected |
Definition at line 507 of file bmsparsevec_serial.h.
|
protected |
Definition at line 481 of file bmsparsevec_serial.h.
|
protected |
Definition at line 494 of file bmsparsevec_serial.h.
|
protected |
Definition at line 497 of file bmsparsevec_serial.h.
|
protected |
Definition at line 496 of file bmsparsevec_serial.h.
|
protected |
Definition at line 492 of file bmsparsevec_serial.h.
|
protected |
Definition at line 487 of file bmsparsevec_serial.h.
|
protected |
Definition at line 485 of file bmsparsevec_serial.h.
|
protected |
Definition at line 482 of file bmsparsevec_serial.h.
|
protected |
Definition at line 498 of file bmsparsevec_serial.h.
|
protected |
Definition at line 493 of file bmsparsevec_serial.h.
|
protected |
Definition at line 495 of file bmsparsevec_serial.h.
|
protected |
Definition at line 488 of file bmsparsevec_serial.h.
|
protected |
Definition at line 484 of file bmsparsevec_serial.h.