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 "bmundef.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 43 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 56 of file sample12.cpp.

## Function Documentation

## bv_set_bit_no_check_test()

void bv_set_bit_no_check_test | ( |  | ) |

static

Examples
  sample12.cpp.

Definition at line 128 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()

void bv_set_bit_test | ( |  | ) |

static

Examples
  sample12.cpp.

Definition at line 98 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()

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 172 of file sample12.cpp.

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

Referenced by main().

## combine_or_test()

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 156 of file sample12.cpp.

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

Referenced by main().

## generate_test_vectors()

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 75 of file sample12.cpp.

References vector_max.

Referenced by main().

## main()

int main | ( | void |  | ) |

Definition at line 189 of file sample12.cpp.

References bv_set_bit_no_check_test(), bv_set_bit_test(), bvector_bulk_set_test(), bm::bvector< Alloc >::clear(), bm::bvector< Alloc >::clear_bit(), bm::combine_or(), combine_or_test(), bm::chrono_taker< TOut >::ct_all, bm::bvector< Alloc >::end(), bm::bvector< Alloc >::extract_next(), bm::bvector< Alloc >::first(), bm::bvector< Alloc >::flip(), generate_test_vectors(), bm::bvector< Alloc >::init(), bm::chrono_taker< TOut >::print_duration_map(), PrintContainer(), bm::bvector< Alloc >::reset(), bm::bvector< Alloc >::set(), bm::bvector< Alloc >::set_bit(), bm::bvector< Alloc >::set_bit_conditional(), bm::bvector< Alloc >::set_bit_no_check(), bm::bvector< Alloc >::set_range(), bm::bvector< Alloc >::swap(), and timing_map.

## PrintContainer()

template<class T>

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

Definition at line 63 of file sample12.cpp.

Referenced by main().

## Variable Documentation

## benchmark_count

const unsigned benchmark_count = 1000

Definition at line 58 of file sample12.cpp.

## timing_map

bm::chrono_taker ::duration_map_type timing_map

Definition at line 53 of file sample12.cpp.

## vector_max

bm_size_type vector_max = 4000000

Definition at line 59 of file sample12.cpp.