BitMagic-C++
|
Example: str_sparse_vector<> insertion sort example. More...
#include <iostream>
#include <string>
#include <vector>
#include <random>
#include <algorithm>
#include "bm.h"
#include "bmstrsparsevec.h"
#include "bmsparsevec_algo.h"
Go to the source code of this file.
Typedefs | |
typedef bm::bvector | bvector_type |
typedef bm::str_sparse_vector< char, bvector_type, 32 > | str_sv_type |
Functions | |
static void | generate_string_set (vector< string > &str_vec) |
static void | insertion_sort (str_sv_type &str_sv, const vector< string > &str_vec) |
int | main (void) |
Example: str_sparse_vector<> insertion sort example.
Example: str_sparse_vector<> back insert iterator example.
This example loads sparse vector from an STL container uses re-mapping to compress, serialize and save container to disk. Example also illustrates how to check memory footprint.
Definition in file strsvsample02.cpp.
typedef bm::bvector bvector_type |
Definition at line 44 of file strsvsample02.cpp.
typedef bm::str_sparse_vector<char, bvector_type, 32> str_sv_type |
Definition at line 52 of file strsvsample02.cpp.
|
static |
|
static |
Definition at line 81 of file strsvsample02.cpp.
References bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::insert(), and bm::sparse_vector_scanner< SV >::lower_bound_str().
Referenced by main().
int main | ( | void | ) |
Definition at line 100 of file strsvsample02.cpp.
References bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::begin(), BM_DECLARE_TEMP_BLOCK, bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::end(), generate_string_set(), insertion_sort(), and bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::optimize().