BitMagic-C++: rscsample01.cpp File Reference

BitMagic-C++

Typedefs | Functions
rscsample01.cpp File Reference

Example: rsc_sparse_vector<> usage. More...

`#include <iostream>`
`#include <vector>`
`#include "bm.h"`
`#include "bmsparsevec.h"`
`#include "bmsparsevec_compr.h"`
`#include "bmsparsevec_serial.h"`
Include dependency graph for rscsample01.cpp:

Go to the source code of this file.

## Typedefs
typedef bm::sparse_vector< unsigned, bm::bvector<> > | sparse_vector_u32
typedef bm::rsc_sparse_vector< unsigned, sparse_vector_u32 > | rsc_sparse_vector_u32

## Functions
template<class SV >
void | print_svector (const SV &sv, bool show_nulls=false)
int | main (void)

## Detailed Description

Example: rsc_sparse_vector<> usage.

rsc_sparse_vector<> is a sparse vector which uses bit-transposition and rank-select succinct method of compression of NULL (unassigned) values. Unassigned values are dropped (as transposed columns) from the bit-matrix.

rsc_sparse_vector<> is basically a read-only structure, which can be used for compact data storage and search. Random access to elements is possible with a penalty of bit-vector Rank or Select operations.

Definition in file rscsample01.cpp.

## Typedef Documentation

## ◆ rsc_sparse_vector_u32

typedef bm::rsc_sparse_vector<unsigned, sparse_vector_u32 > rsc_sparse_vector_u32

Examples
  rscsample01.cpp.

Definition at line 53 of file rscsample01.cpp.

## ◆ sparse_vector_u32

typedef bm::sparse_vector<unsigned, bm::bvector<> > sparse_vector_u32

Examples
  rscsample01.cpp.

Definition at line 52 of file rscsample01.cpp.

## Function Documentation

## ◆ main()

int main | ( | void |  | ) |

Examples
  rscsample01.cpp.

Definition at line 80 of file rscsample01.cpp.

References BM_DECLARE_TEMP_BLOCK, bm::sparse_vector_serial_layout< SV >::buf(), bm::rsc_sparse_vector< Val, SV >::equal(), bm::sparse_vector< Val, BV >::equal(), bm::rsc_sparse_vector< Val, SV >::load_from(), bm::rsc_sparse_vector< Val, SV >::load_to(), bm::rsc_sparse_vector< Val, SV >::optimize(), print_svector(), bm::sparse_vector_serial_layout< SV >::size(), bm::sparse_vector_deserialize(), bm::sparse_vector_serialize(), and bm::use_null.

## ◆ print_svector()

template<class SV >

void print_svector | ( | const SV & | sv,
|  | bool | show_nulls = `false`
| ) |  |

Examples
  rscsample01.cpp, svsample04.cpp, and svsample05.cpp.

Definition at line 56 of file rscsample01.cpp.

Referenced by main().