|
BitMagic-C++
|
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"
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) |
| 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). | |
| template<class SV> | |
| void | print_svector2 (const SV &sv, bool show_nulls=false) |
| Prints succinct vector using try_get() random access method. | |
| int | main (void) |
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 bm::rsc_sparse_vector<unsigned, sparse_vector_u32 > rsc_sparse_vector_u32 |
Definition at line 54 of file rscsample01.cpp.
| typedef bm::sparse_vector<unsigned, bm::bvector<> > sparse_vector_u32 |
Definition at line 53 of file rscsample01.cpp.
| int main | ( | void | ) |
Definition at line 112 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(), print_svector2(), bm::sparse_vector_serial_layout< SV >::size(), bm::sparse_vector_deserialize(), bm::sparse_vector_serialize(), and bm::use_null.
| 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).
Definition at line 61 of file rscsample01.cpp.
Referenced by main().
| void print_svector2 | ( | const SV & | sv, |
| bool | show_nulls = false ) |
Prints succinct vector using try_get() random access method.
Definition at line 89 of file rscsample01.cpp.
Referenced by main().