svsample01.cpp File Reference

Example: sparse_vector<> container set values. More...

`#include <iostream>`
`#include <algorithm>`
`#include "bm.h"`
`#include "bmsparsevec.h"`
`#include "bmundef.h"`
Include dependency graph for svsample01.cpp:

Go to the source code of this file.

## Typedefs

typedef bm::sparse_vector< unsigned, bm::bvector<> > | sparse_vector_u32
typedef bm::sparse_vector< int, bm::bvector<> > | sparse_vector_i32

## Functions

static void | Demo1 ()
| bm::sparse_vector for unsigned int data
static void | Demo2 ()
| bm::sparse_vector can also support signed ints.
int | main (void)

## Detailed Description

Example: sparse_vector<> container set values.

Definition in file svsample01.cpp.

## Typedef Documentation

## sparse_vector_i32

typedef bm::sparse_vector<int, bm::bvector<> > sparse_vector_i32

Examples
  svsample01.cpp, and svsample02.cpp.

Definition at line 47 of file svsample01.cpp.

## sparse_vector_u32

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

Definition at line 46 of file svsample01.cpp.

## Function Documentation

## Demo1()

void Demo1 | ( |  | ) |

static

bm::sparse_vector for unsigned int data

Examples
  svsample01.cpp.

Definition at line 53 of file svsample01.cpp.

References bm::sparse_vector< Val, BV >::at(), bm::sparse_vector< Val, BV >::begin(), BM_DECLARE_TEMP_BLOCK, bm::sparse_vector< Val, BV >::end(), bm::sparse_vector< Val, BV >::import(), bm::sparse_vector< Val, BV >::optimize(), and bm::sparse_vector< Val, BV >::size().

Referenced by main().

## Demo2()

void Demo2 | ( |  | ) |

static

bm::sparse_vector can also support signed ints.

The container transforms it from complementary code to more optimal representation so that

Examples
  svsample01.cpp.

Definition at line 96 of file svsample01.cpp.

References bm::sparse_vector< Val, BV >::begin(), BM_DECLARE_TEMP_BLOCK, bm::sparse_vector< Val, BV >::end(), bm::sparse_vector< Val, BV >::import(), bm::sparse_vector< Val, BV >::optimize(), and bm::sparse_vector< Val, BV >::size().

Referenced by main().

## main()

int main | ( | void |  | ) |

Definition at line 121 of file svsample01.cpp.

References Demo1(), and Demo2().