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 "bmundef.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_u32rsc_sparse_vector_u32
 

Functions

template<class SV >
void print_svector (const SV &sv, bool show_nulls=false)
 Prints the vector using is_null() and get() Please note, that random access is not the fastest, const_iterator is preferred in many cases (better performance) More...
 
template<class SV >
void print_svector2 (const SV &sv, bool show_nulls=false)
 Prints succinct vector using try_get() random access method. More...
 
int main (void)
  More...
 

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.

Function Documentation

◆ main()

int main ( void  )

◆ print_svector()

template<class SV >
void print_svector ( const SV &  sv,
bool  show_nulls = false 
)

Prints the vector using is_null() and get() Please note, that random access is not the fastest, const_iterator is preferred in many cases (better performance)

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

Definition at line 61 of file rscsample01.cpp.

Referenced by main().

◆ print_svector2()

template<class SV >
void print_svector2 ( const SV &  sv,
bool  show_nulls = false 
)

Prints succinct vector using try_get() random access method.

Examples
rscsample01.cpp.

Definition at line 89 of file rscsample01.cpp.

Referenced by main().