|
BitMagic-C++
|
Example: str_sparse_vector<> back insert iterator example. More...
#include <assert.h>#include <iostream>#include <string>#include <vector>#include <random>#include <algorithm>#include <fstream>#include "bm.h"#include "bmstrsparsevec.h"#include "bmsparsevec_serial.h"#include "bmundef.h"
Go to the source code of this file.
Typedefs | |
| typedef bm::str_sparse_vector< char, bvector_type, 32 > | str_sv_type |
Functions | |
| static void | generate_string_set (vector< string > &str_vec) |
| int | main (void) |
Example: str_sparse_vector<> back insert iterator example.
This example loads sparse vector from an STL container uses character re-mapping to compress, serialize and save container to disk. Example also illustrates how to check memory footprint.
Definition in file strsvsample03.cpp.
| typedef bm::str_sparse_vector<char, bvector_type, 32> str_sv_type |
Definition at line 58 of file strsvsample03.cpp.
|
static |
Definition at line 64 of file strsvsample03.cpp.
Referenced by main().
| int main | ( | void | ) |
Definition at line 84 of file strsvsample03.cpp.
References BM_DECLARE_TEMP_BLOCK, bm::sparse_vector_serial_layout< SV >::buf(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::calc_stat(), bm::COPY_RTABLES, bm::str_sparse_vector< CharType, BV, STR_SIZE >::equal(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::freeze(), generate_string_set(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::get_back_inserter(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::is_ro(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::optimize(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap_from(), bm::sparse_vector_serial_layout< SV >::size(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::size(), and bm::sparse_vector_serialize().