BitMagic-C++: sample12.cpp File Reference

BitMagic-C++

Macros | Typedefs | Functions | Variables
sample12.cpp File Reference

Example: bvector<> analysis of bit setting methods. More...

`#include <iostream>`
`#include <vector>`
`#include "bm.h"`
`#include "bmalgo.h"`
`#include "bmtimer.h"`
Include dependency graph for sample12.cpp:

Go to the source code of this file.

## Macros
#define | BM64ADDR

## Typedefs
typedef bm::bvector ::size_type | bm_size_type

## Functions
template<class T >
void | PrintContainer (T first, T last)
static void | generate_test_vectors (std::vector< bm_size_type > &v1, std::vector< bm_size_type > &v2, std::vector< bm_size_type > &v3)
static void | bv_set_bit_test ()
static void | bv_set_bit_no_check_test ()
static void | combine_or_test (std::vector< bm_size_type > &v1, std::vector< bm_size_type > &v2, std::vector< bm_size_type > &v3)
static void | bvector_bulk_set_test (std::vector< bm_size_type > &v1, std::vector< bm_size_type > &v2, std::vector< bm_size_type > &v3)
int | main (void)

## Variables
bm::chrono_taker::duration_map_type | timing_map
const unsigned | benchmark_count = 1000
bm_size_type | vector_max = 4000000

## Detailed Description

Example: bvector<> analysis of bit setting methods.

Definition in file sample12.cpp.

## Macro Definition Documentation

## ◆ BM64ADDR

#define BM64ADDR

Definition at line 42 of file sample12.cpp.

## Typedef Documentation

## ◆ bm_size_type

typedef bm::bvector ::size_type bm_size_type

Examples
  sample12.cpp, and sample8.cpp.

Definition at line 53 of file sample12.cpp.

## Function Documentation

## ◆ bv_set_bit_no_check_test()

static void bv_set_bit_no_check_test | ( |  | ) |
| static

Examples
  sample12.cpp.

Definition at line 125 of file sample12.cpp.

References benchmark_count, bm::bvector< Alloc >::init(), bm::bvector< Alloc >::set_bit_no_check(), timing_map, and vector_max.

Referenced by main().

## ◆ bv_set_bit_test()

static void bv_set_bit_test | ( |  | ) |
| static

Examples
  sample12.cpp.

Definition at line 95 of file sample12.cpp.

References benchmark_count, bm::bvector< Alloc >::reset(), bm::bvector< Alloc >::set_bit(), timing_map, and vector_max.

Referenced by main().

## ◆ bvector_bulk_set_test()

static void bvector_bulk_set_test | ( | std::vector< bm_size_type > & | v1,
|  | std::vector< bm_size_type > & | v2,
|  | std::vector< bm_size_type > & | v3
| ) |  |
| static

Examples
  sample12.cpp.

Definition at line 169 of file sample12.cpp.

References benchmark_count, bm::bvector< Alloc >::set(), and timing_map.

Referenced by main().

## ◆ combine_or_test()

static void combine_or_test | ( | std::vector< bm_size_type > & | v1,
|  | std::vector< bm_size_type > & | v2,
|  | std::vector< bm_size_type > & | v3
| ) |  |
| static

Examples
  sample12.cpp.

Definition at line 153 of file sample12.cpp.

References benchmark_count, bm::combine_or(), bm::bvector< Alloc >::end(), and timing_map.

Referenced by main().

## ◆ generate_test_vectors()

static void generate_test_vectors | ( | std::vector< bm_size_type > & | v1,
|  | std::vector< bm_size_type > & | v2,
|  | std::vector< bm_size_type > & | v3
| ) |  |
| static

Examples
  sample12.cpp.

Definition at line 72 of file sample12.cpp.

References vector_max.

Referenced by main().

## ◆ main()

int main | ( | void |  | ) |

Examples
  sample12.cpp.

Definition at line 186 of file sample12.cpp.

References bv_set_bit_no_check_test(), bv_set_bit_test(), bvector_bulk_set_test(), bm::combine_or(), combine_or_test(), bm::chrono_taker::ct_all, bm::bvector< Alloc >::end(), bm::bvector< Alloc >::extract_next(), bm::bvector< Alloc >::first(), generate_test_vectors(), bm::bvector< Alloc >::init(), bm::chrono_taker::print_duration_map(), PrintContainer(), bm::bvector< Alloc >::set_bit_no_check(), bm::bvector< Alloc >::swap(), and timing_map.

## ◆ PrintContainer()

template<class T >

void PrintContainer | ( | T | first,
|  | T | last
| ) |  |

Examples
  sample12.cpp.

Definition at line 60 of file sample12.cpp.

Referenced by main().

## Variable Documentation

## ◆ benchmark_count

const unsigned benchmark_count = 1000

Examples
  sample12.cpp.

Definition at line 55 of file sample12.cpp.

Referenced by bv_set_bit_no_check_test(), bv_set_bit_test(), bvector_bulk_set_test(), and combine_or_test().

## ◆ timing_map

bm::chrono_taker::duration_map_type timing_map

Examples
  sample12.cpp.

Definition at line 50 of file sample12.cpp.

Referenced by bv_set_bit_no_check_test(), bv_set_bit_test(), bvector_bulk_set_test(), combine_or_test(), and main().

## ◆ vector_max

bm_size_type vector_max = 4000000

Examples
  sample12.cpp.

Definition at line 56 of file sample12.cpp.

Referenced by bv_set_bit_no_check_test(), bv_set_bit_test(), and generate_test_vectors().