BitMagic-C++: strsvsample02.cpp File Reference

BitMagic-C++

Typedefs | Functions
strsvsample02.cpp File Reference

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"`
Include dependency graph for strsvsample02.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)
static void | insertion_sort (str_sv_type &str_sv, const vector< string > &str_vec)
int | main (void)

## Detailed Description

Example: str_sparse_vector<> insertion sort example.

Definition in file strsvsample02.cpp.

## Typedef Documentation

## ◆ bvector_type

typedef bm::bvector bvector_type

Examples
  strsvsample02.cpp.

Definition at line 44 of file strsvsample02.cpp.

## ◆ str_sv_type

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

Examples
  strsvsample02.cpp.

Definition at line 52 of file strsvsample02.cpp.

## Function Documentation

## ◆ generate_string_set()

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

Examples
  strsvsample02.cpp.

Definition at line 58 of file strsvsample02.cpp.

Referenced by main().

## ◆ insertion_sort()

static void insertion_sort | ( | str_sv_type & | str_sv,
|  | const vector< string > & | str_vec
| ) |  |
| static

Examples
  strsvsample02.cpp.

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().

## ◆ main()

int main | ( | void |  | ) |

Examples
  strsvsample02.cpp.

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().