BitMagic-C++: strsvsample03.cpp File Reference

BitMagic-C++

Typedefs | Functions
strsvsample03.cpp File Reference

Example: str_sparse_vector<> back insert iterator example. More...

`#include <iostream>`
`#include <string>`
`#include <vector>`
`#include <random>`
`#include <algorithm>`
`#include <fstream>`
`#include "bm.h"`
`#include "bmstrsparsevec.h"`
`#include "bmsparsevec_serial.h"`
Include dependency graph for strsvsample03.cpp:

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)
int | main (void)

## Detailed Description

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 strsvsample03.cpp.

## Typedef Documentation

## ◆ bvector_type

typedef bm::bvector bvector_type

Examples
  strsvsample03.cpp.

Definition at line 48 of file strsvsample03.cpp.

## ◆ str_sv_type

typedef bm::str_sparse_vector<char, bvector_type, 32> str_sv_type

Examples
  strsvsample03.cpp.

Definition at line 56 of file strsvsample03.cpp.

## Function Documentation

## ◆ generate_string_set()

static void generate_string_set | ( | vector< string > & | str_vec | ) |
| static

Examples
  strsvsample03.cpp.

Definition at line 62 of file strsvsample03.cpp.

Referenced by main().

## ◆ main()

int main | ( | void |  | ) |

Examples
  strsvsample03.cpp.

Definition at line 82 of file strsvsample03.cpp.

References BM_DECLARE_TEMP_BLOCK, bm::sparse_vector_serial_layout< SV >::buf(), bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::calc_stat(), bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::back_insert_iterator::flush(), generate_string_set(), bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::get_back_inserter(), bm::bv_statistics::memory_used, bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::optimize(), bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::remap_from(), bm::sparse_vector_serial_layout< SV >::size(), and bm::sparse_vector_serialize().