sample26.cpp File Reference

Example: bvector<> with immutability (read-only). More...

`#include <stdlib.h>`
`#include <iostream>`
`#include <cassert>`
`#include "bm.h"`
`#include "bmundef.h"`
Include dependency graph for sample26.cpp:

Go to the source code of this file.

## Functions

static void | fill_bvector (bm::bvector<> *bv1, bm::bvector<> *bv2)
| Fill bit-vectors with values using dense and sparse distrubutions.
static void | print_statistics (const bm::bvector<> &bv)
int | main (void)

## Variables

const unsigned | MAX_VALUE = 1000000

## Detailed Description

Example: bvector<> with immutability (read-only).

Definition in file sample26.cpp.

## Function Documentation

## fill_bvector()

void fill_bvector | ( | bm::bvector<> * | bv1,
|  | bm::bvector<> * | bv2 )

static

Fill bit-vectors with values using dense and sparse distrubutions.

Definition at line 48 of file sample26.cpp.

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

Referenced by main().

## main()

int main | ( | void |  | ) |

Definition at line 73 of file sample26.cpp.

References BM_DECLARE_TEMP_BLOCK, bm::bvector< Alloc >::equal(), fill_bvector(), bm::bvector< Alloc >::freeze(), bm::bvector< Alloc >::is_ro(), bm::bvector< Alloc >::optimize(), print_statistics(), bm::READONLY, bm::READWRITE, bm::bvector< Alloc >::set(), and bm::bvector< Alloc >::swap().

## print_statistics()

void print_statistics | ( | const bm::bvector<> & | bv | ) |

static

Definition at line 60 of file sample26.cpp.

References bm::bv_statistics::bit_blocks, bm::bvector< Alloc >::calc_stat(), bm::bv_statistics::gap_blocks, bm::bv_statistics::gap_cap_overhead, bm::bv_statistics::max_serialize_mem, and bm::bv_statistics::memory_used.

Referenced by main().

## Variable Documentation

## MAX_VALUE

const unsigned MAX_VALUE = 1000000

Definition at line 43 of file sample26.cpp.