BitMagic-C++: bm::sparse_vector_deserializer< SV > Class Template Reference

BitMagic-C++

Public Types | Public Member Functions | Data Fields | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes
bm::sparse_vector_deserializer< SV > Class Template Reference

sparse vector de-serializer More...

`#include <bmsparsevec_serial.h>`

Collaboration diagram for bm::sparse_vector_deserializer< SV >:
[legend]

## Public Types
typedef SV::bvector_type | bvector_type
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

## Public Member Functions
| sparse_vector_deserializer ()
| ~sparse_vector_deserializer ()
void | deserialize (SV &sv, const unsigned char *buf)
void | deserialize_range (SV &sv, const unsigned char *buf, size_type from, size_type to)
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)

## Data Fields
const typedef bvector_type * | bvector_type_const_ptr

## Protected Types
typedef bvector_type::allocator_type | alloc_type
typedef bm::serializer< bvector_type >::bv_ref_vector_type | bv_ref_vector_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)
void | deserialize_plains (SV &sv, unsigned plains, const unsigned char *buf, const bvector_type *mask_bv=0)
| deserialize bit-vector plains More...
void | load_plains_off_table (bm::decoder &dec, unsigned plains)
| load offset table More...
int | load_null_plain (SV &sv, int plains, const unsigned char *buf, const bvector_type *mask_bv)
| load NULL bit-plain (returns new plains count) More...

## Static Protected Member Functions
static void | load_remap (SV &sv, const unsigned char *remap_buf_ptr)
| load string remap dict More...
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...

## Protected Attributes
const unsigned char * | remap_buf_ptr_
alloc_type | alloc_
bm::word_t * | temp_block_
allocator_pool_type | pool_
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_
bv_ref_vector_type | bv_ref_
bool | idx_range_set_
size_type | idx_range_from_
size_type | idx_range_to_

## Detailed Description

### template<typename SV>
class bm::sparse_vector_deserializer< SV >

sparse vector de-serializer

Examples
  rscsample02.cpp, strsvsample05.cpp, and svsample08.cpp.

Definition at line 223 of file bmsparsevec_serial.h.

## Member Typedef Documentation

## ◆ alloc_type

template<typename SV >

typedef bvector_type::allocator_type bm::sparse_vector_deserializer< SV >::alloc_type
| protected

Definition at line 280 of file bmsparsevec_serial.h.

## ◆ allocator_pool_type

template<typename SV >

typedef bvector_type::allocator_type::allocator_pool_type bm::sparse_vector_deserializer< SV >::allocator_pool_type

Definition at line 231 of file bmsparsevec_serial.h.

## ◆ bv_ref_vector_type

template<typename SV >

typedef bm::serializer<bvector_type>::bv_ref_vector_type bm::sparse_vector_deserializer< SV >::bv_ref_vector_type
| protected

Definition at line 281 of file bmsparsevec_serial.h.

## ◆ bvector_type

template<typename SV >

typedef SV::bvector_type bm::sparse_vector_deserializer< SV >::bvector_type

Definition at line 226 of file bmsparsevec_serial.h.

## ◆ bvector_type_ptr

template<typename SV >

typedef bvector_type* bm::sparse_vector_deserializer< SV >::bvector_type_ptr

Definition at line 228 of file bmsparsevec_serial.h.

## ◆ size_type

template<typename SV >

typedef SV::size_type bm::sparse_vector_deserializer< SV >::size_type

Definition at line 230 of file bmsparsevec_serial.h.

## ◆ value_type

template<typename SV >

typedef SV::value_type bm::sparse_vector_deserializer< SV >::value_type

Definition at line 229 of file bmsparsevec_serial.h.

## Constructor & Destructor Documentation

## ◆ sparse_vector_deserializer()

template<typename SV >

bm::sparse_vector_deserializer< SV >::sparse_vector_deserializer

Definition at line 767 of file bmsparsevec_serial.h.

References bm::sparse_vector_deserializer< SV >::alloc_, bm::sparse_vector_deserializer< SV >::idx_range_set_, bm::sparse_vector_deserializer< SV >::not_null_mask_bv_, bm::sparse_vector_deserializer< SV >::pool_, bm::sparse_vector_deserializer< SV >::rsc_mask_bv_, and bm::sparse_vector_deserializer< SV >::temp_block_.

## ◆ ~sparse_vector_deserializer()

template<typename SV >

bm::sparse_vector_deserializer< SV >::~sparse_vector_deserializer

Definition at line 779 of file bmsparsevec_serial.h.

## Member Function Documentation

## ◆ deserialize() [1/3]

template<typename SV >

void bm::sparse_vector_deserializer< SV >::deserialize | ( | SV & | sv,
|  | const unsigned char * | buf
| ) |  |
| inline

Deserialize sparse vector

Parameters

  sv | - [out] target sparse vector to populate
  buf | - source memory pointer

Definition at line 243 of file bmsparsevec_serial.h.

References bm::sparse_vector_deserializer< SV >::deserialize_sv(), and bm::sparse_vector_deserializer< SV >::idx_range_set_.

Referenced by main(), and bm::sparse_vector_deserialize().

## ◆ deserialize() [2/3]

template<typename SV >

void bm::sparse_vector_deserializer< SV >::deserialize | ( | SV & | sv,
|  | const unsigned char * | buf,
|  | const bvector_type & | mask_bv
| ) |  |
| inline

Deserialize sparse vector using address mask vector Address mask defines (by set bits) which vector elements to be extracted from the compressed BLOB

Parameters

  sv | - [out] target sparse vector to populate
  buf | - source memory pointer
  mask_bv | - AND mask bit-vector (address gather vector)

Definition at line 273 of file bmsparsevec_serial.h.

References bm::sparse_vector_deserializer< SV >::deserialize_sv(), and bm::sparse_vector_deserializer< SV >::idx_range_set_.

## ◆ deserialize() [3/3]

template<typename SV >

void bm::sparse_vector_deserializer< SV >::deserialize | ( | SV & | sv,
|  | const unsigned char * | buf,
|  | size_type | from,
|  | size_type | to
| ) |  |
| inline

Definition at line 257 of file bmsparsevec_serial.h.

References bm::sparse_vector_deserializer< SV >::deserialize_range().

## ◆ deserialize_plains()

template<typename SV >

void bm::sparse_vector_deserializer< SV >::deserialize_plains | ( | SV & | sv,
|  | unsigned | plains,
|  | const unsigned char * | buf,
|  | const bvector_type * | mask_bv = `0`
| ) |  |
| protected

deserialize bit-vector plains

Definition at line 958 of file bmsparsevec_serial.h.

References BM_ASSERT, and bm::bvector< Alloc >::opt_compress.

## ◆ deserialize_range()

template<typename SV >

void bm::sparse_vector_deserializer< SV >::deserialize_range | ( | SV & | sv,
|  | const unsigned char * | buf,
|  | size_type | from,
|  | size_type | to
| ) |  |

Deserialize sparse vector for the range [from, to]

Parameters

  sv | - [out] target sparse vector to populate
  buf | - source memory pointer
  from | - start vector index for deserialization range
  to | - end vector index for deserialization range

Definition at line 788 of file bmsparsevec_serial.h.

References bm::decoder::get_64().

Referenced by bm::sparse_vector_deserializer< SV >::deserialize(), and main().

## ◆ deserialize_sv()

template<typename SV >

void bm::sparse_vector_deserializer< SV >::deserialize_sv | ( | SV & | sv,
|  | const unsigned char * | buf,
|  | const bvector_type * | mask_bv
| ) |  |
| protected

Definition at line 856 of file bmsparsevec_serial.h.

References BM_ASSERT, bm::decoder::get_64(), and bm::bvector< Alloc >::opt_compress.

Referenced by bm::sparse_vector_deserializer< SV >::deserialize().

## ◆ load_header()

template<typename SV >

unsigned bm::sparse_vector_deserializer< SV >::load_header | ( | bm::decoder & | dec,
|  | SV & | sv,
|  | unsigned char & | matr_s_ser
| ) |  |
| protected

Deserialize header/version and other common info.

Returns
  number of bit-plains

Definition at line 922 of file bmsparsevec_serial.h.

References BM_ASSERT, bm::decoder::get_64(), and bm::decoder_base::get_8().

## ◆ load_null_plain()

template<typename SV >

int bm::sparse_vector_deserializer< SV >::load_null_plain | ( | SV & | sv,
|  | int | plains,
|  | const unsigned char * | buf,
|  | const bvector_type * | mask_bv
| ) |  |
| protected

load NULL bit-plain (returns new plains count)

Definition at line 1035 of file bmsparsevec_serial.h.

References BM_ASSERT, and bm::bvector< Alloc >::opt_compress.

## ◆ load_plains_off_table()

template<typename SV >

void bm::sparse_vector_deserializer< SV >::load_plains_off_table | ( | bm::decoder & | dec,
|  | unsigned | plains
| ) |  |
| protected

load offset table

Definition at line 1094 of file bmsparsevec_serial.h.

References bm::decoder::get_64().

## ◆ load_remap()

template<typename SV >

void bm::sparse_vector_deserializer< SV >::load_remap | ( | SV & | sv,
|  | const unsigned char * | remap_buf_ptr
| ) |  |
| staticprotected

load string remap dict

Definition at line 1108 of file bmsparsevec_serial.h.

References BM_ASSERT, bm::decoder::get_64(), bm::decoder_base::get_8(), and bm::decoder_base::memcpy().

## ◆ raise_invalid_64bit()

template<typename SV >

void bm::sparse_vector_deserializer< SV >::raise_invalid_64bit
| staticprotected

throw error on incorrect deserialization

Definition at line 1171 of file bmsparsevec_serial.h.

## ◆ raise_invalid_bitdepth()

template<typename SV >

void bm::sparse_vector_deserializer< SV >::raise_invalid_bitdepth
| staticprotected

throw error on incorrect deserialization

Definition at line 1183 of file bmsparsevec_serial.h.

## ◆ raise_invalid_header()

template<typename SV >

void bm::sparse_vector_deserializer< SV >::raise_invalid_header
| staticprotected

throw error on incorrect deserialization

Definition at line 1159 of file bmsparsevec_serial.h.

## Field Documentation

## ◆ alloc_

template<typename SV >

alloc_type bm::sparse_vector_deserializer< SV >::alloc_
| protected

Definition at line 323 of file bmsparsevec_serial.h.

Referenced by bm::sparse_vector_deserializer< SV >::sparse_vector_deserializer().

## ◆ bv_ref_

template<typename SV >

bv_ref_vector_type bm::sparse_vector_deserializer< SV >::bv_ref_
| protected

Definition at line 333 of file bmsparsevec_serial.h.

## ◆ bvector_type_const_ptr

template<typename SV >

const typedef bvector_type* bm::sparse_vector_deserializer< SV >::bvector_type_const_ptr

Definition at line 227 of file bmsparsevec_serial.h.

## ◆ deserial_

template<typename SV >

bm::deserializer<bvector_type, bm::decoder> bm::sparse_vector_deserializer< SV >::deserial_
| protected

Definition at line 326 of file bmsparsevec_serial.h.

## ◆ idx_range_from_

template<typename SV >

size_type bm::sparse_vector_deserializer< SV >::idx_range_from_
| protected

Definition at line 336 of file bmsparsevec_serial.h.

## ◆ idx_range_set_

template<typename SV >

bool bm::sparse_vector_deserializer< SV >::idx_range_set_
| protected

Definition at line 335 of file bmsparsevec_serial.h.

Referenced by bm::sparse_vector_deserializer< SV >::deserialize(), and bm::sparse_vector_deserializer< SV >::sparse_vector_deserializer().

## ◆ idx_range_to_

template<typename SV >

size_type bm::sparse_vector_deserializer< SV >::idx_range_to_
| protected

Definition at line 337 of file bmsparsevec_serial.h.

## ◆ not_null_mask_bv_

template<typename SV >

bvector_type bm::sparse_vector_deserializer< SV >::not_null_mask_bv_
| protected

Definition at line 329 of file bmsparsevec_serial.h.

Referenced by bm::sparse_vector_deserializer< SV >::sparse_vector_deserializer().

## ◆ off_vect_

template<typename SV >

bm::heap_vector<size_t, alloc_type, true> bm::sparse_vector_deserializer< SV >::off_vect_
| protected

Definition at line 331 of file bmsparsevec_serial.h.

## ◆ op_deserial_

template<typename SV >

bm::operation_deserializer<bvector_type> bm::sparse_vector_deserializer< SV >::op_deserial_
| protected

Definition at line 327 of file bmsparsevec_serial.h.

## ◆ pool_

template<typename SV >

allocator_pool_type bm::sparse_vector_deserializer< SV >::pool_
| protected

Definition at line 325 of file bmsparsevec_serial.h.

Referenced by bm::sparse_vector_deserializer< SV >::sparse_vector_deserializer().

## ◆ remap_buf_ptr_

template<typename SV >

const unsigned char* bm::sparse_vector_deserializer< SV >::remap_buf_ptr_
| protected

Definition at line 322 of file bmsparsevec_serial.h.

## ◆ rsc_compressor_

template<typename SV >

bm::rank_compressor<bvector_type> bm::sparse_vector_deserializer< SV >::rsc_compressor_
| protected

Definition at line 328 of file bmsparsevec_serial.h.

## ◆ rsc_mask_bv_

template<typename SV >

bvector_type bm::sparse_vector_deserializer< SV >::rsc_mask_bv_
| protected

Definition at line 330 of file bmsparsevec_serial.h.

Referenced by bm::sparse_vector_deserializer< SV >::sparse_vector_deserializer().

## ◆ temp_block_

template<typename SV >

bm::word_t* bm::sparse_vector_deserializer< SV >::temp_block_
| protected

Definition at line 324 of file bmsparsevec_serial.h.

Referenced by bm::sparse_vector_deserializer< SV >::sparse_vector_deserializer().

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

- bmsparsevec_serial.h