BitMagic-C++: svsample07.cpp File Reference

BitMagic-C++

Typedefs | Functions
svsample07.cpp File Reference

Example: sparse_vector<> lower bound search. More...

`#include <iostream>`
`#include <vector>`
`#include <chrono>`
`#include <algorithm>`
`#include <random>`
`#include <stdexcept>`
`#include "bm.h"`
`#include "bmsparsevec.h"`
`#include "bmsparsevec_algo.h"`
Include dependency graph for svsample07.cpp:

Go to the source code of this file.

## Typedefs
typedef bm::sparse_vector< bm::id_t, bm::bvector<> > | sparse_vector_u32

## Functions
static void | generate_set (vector< unsigned > &vec)
static void | insertion_sort (sparse_vector_u32 &sv, const vector< unsigned > &vec)
int | main (void)

## Detailed Description

Example: sparse_vector<> lower bound search.

Definition in file svsample07.cpp.

## Typedef Documentation

## ◆ sparse_vector_u32

typedef bm::sparse_vector<bm::id_t, bm::bvector<> > sparse_vector_u32

Examples
  svsample07.cpp.

Definition at line 46 of file svsample07.cpp.

## Function Documentation

## ◆ generate_set()

static void generate_set | ( | vector< unsigned > & | vec | ) |
| static

Examples
  svsample07.cpp.

Definition at line 51 of file svsample07.cpp.

Referenced by main().

## ◆ insertion_sort()

static void insertion_sort | ( | sparse_vector_u32 & | sv,
|  | const vector< unsigned > & | vec
| ) |  |
| static

Examples
  svsample07.cpp.

Definition at line 72 of file svsample07.cpp.

References bm::sparse_vector< Val, BV >::insert(), and bm::sparse_vector_scanner< SV >::lower_bound().

Referenced by main().

## ◆ main()

int main | ( | void |  | ) |

Examples
  svsample07.cpp.

Definition at line 90 of file svsample07.cpp.

References bm::sparse_vector< Val, BV >::begin(), bm::sparse_vector< Val, BV >::const_iterator, bm::sparse_vector< Val, BV >::end(), generate_set(), insertion_sort(), and bm::sparse_vector< Val, BV >::optimize().