Sparse vector serialization
BitMagic Library » Sparse and compressed vectors

Sparse vector serialization. More...

Collaboration diagram for Sparse vector serialization:

## Data Structures

struct | bm::sparse_vector_serial_layout< SV >
| layout class for serialization buffer structure More...
class | bm::sparse_vector_serializer< SV >

## Functions

template<class SV>
void | bm::sparse_vector_serialize (const SV &sv, sparse_vector_serial_layout< SV > &sv_layout, bm::word_t *temp_block=0)
| Serialize sparse vector into a memory buffer(s) structure.
template<class SV>
int | bm::sparse_vector_deserialize (SV &sv, const unsigned char *buf, bm::word_t *temp_block=0)
| Deserialize sparse vector.

## Detailed Description

Sparse vector serialization.

## Function Documentation

## sparse_vector_deserialize()

template<class SV>

int bm::sparse_vector_deserialize | ( | SV & | sv,
|  | const unsigned char * | buf,
|  | bm::word_t * | temp_block = 0 )

Deserialize sparse vector.

Parameters

  sv | - target sparse vector
  buf | - source memory buffer
  temp_block | - temporary block buffer to avoid re-allocations

Returns
  0 (error processing via std::logic_error)

See also
  sparse_vector_deserializer

Examples
  rscsample01.cpp, and svsample02.cpp.

Definition at line 551 of file bmsparsevec_serial.h.

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

Referenced by main(), and SDemo1().

## sparse_vector_serialize()

template<class SV>

void bm::sparse_vector_serialize | ( | const SV & | sv,
|  | sparse_vector_serial_layout< SV > & | sv_layout,
|  | bm::word_t * | temp_block = 0 )

Serialize sparse vector into a memory buffer(s) structure.

Parameters

  sv | - sparse vector to serialize
  sv_layout | - buffer structure to keep the result
  temp_block | - temporary buffer (allocate with BM_DECLARE_TEMP_BLOCK(x) for speed)

See also
  serialization_flags
  sparse_vector_deserializer

Examples
  inv_list.cpp, rscsample01.cpp, strsvsample03.cpp, and svsample02.cpp.

Definition at line 526 of file bmsparsevec_serial.h.

References bm::sparse_vector_serializer< SV >::serialize().

Referenced by main(), SDemo1(), write_as_rsc_svector(), and write_as_svector().