# sample4.cpp File Reference

`#include <stdlib.h>`
`#include <iostream>`
`#include "bm.h"`
`#include "bmserial.h"`
Include dependency graph for sample4.cpp:

Go to the source code of this file.

## Functions

void | fill_bvector (bm::bvector<> *bv)
void | print_statistics (const bm::bvector<> &bv)
unsigned char * | serialize_bvector (bm::serializer< bm::bvector<> > &bvs, bm::bvector<> &bv)
int | main (void)

## Variables

const unsigned | MAX_VALUE = 1000000

## Function Documentation

void fill_bvector | ( | bm::bvector<> * | bv | ) |

Definition at line 52 of file sample4.cpp.

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

int main | ( | void |  | ) |

Definition at line 105 of file sample4.cpp.

References bm::BM_GAP, bm::serializer< BV >::byte_order_serialization(), bm::deserialize(), fill_bvector(), bm::serializer< BV >::gap_length_serialization(), bm::bvector< Alloc >::optimize(), print_statistics(), serialize_bvector(), bm::serializer< BV >::set_compression_level(), and bm::bvector< Alloc >::set_new_blocks_strat().

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

Definition at line 64 of file sample4.cpp.

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

unsigned char* serialize_bvector | ( | bm::serializer< bm::bvector<> > & | bvs,
|  | bm::bvector<> & | bv |
| ) |  |  |

Examples:
  sample4.cpp.

Definition at line 77 of file sample4.cpp.

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

Referenced by main().

## Variable Documentation

const unsigned MAX_VALUE = 1000000

Definition at line 46 of file sample4.cpp.