BitMagic-C++
|
Example: Example: memory consumption techniques. More...
#include <iostream>
#include <memory>
#include <map>
#include <vector>
#include <chrono>
#include <algorithm>
#include <stdexcept>
#include "bm.h"
#include "bmalgo.h"
#include "bmtimer.h"
#include "bmserial.h"
#include "bmsparsevec.h"
#include "bmsparsevec_algo.h"
#include "bmsparsevec_serial.h"
#include "bmalgo_similarity.h"
#include "bmdbg.h"
Go to the source code of this file.
Data Structures | |
struct | gap_len_table_sparse< T > |
struct | bv_index |
struct | bvs_index |
struct | vect_index |
struct | sparse_vect_index |
struct | sparse_vect_index::vect_addr |
Typedefs | |
typedef bm::bvector | TBVector |
Functions | |
static TBVector * | construct_bvector () |
template<typename TM > | |
void | destroy_map (TM &id_map) |
static void | generate_random_vector (TBVector *bv) |
static void | generate_bv_index (bv_index &bvi) |
static size_t | calc_memory_footprint (const bv_index &bvi) |
static size_t | convert_bv2bvs (const bv_index &bvi, bvs_index &bvs) |
static size_t | convert_bv2vect (const bv_index &bvi, vect_index &vidx) |
static void | bv2delta (const TBVector &bv, std::vector< unsigned > &vect) |
static size_t | convert_bv2sv (const bv_index &bvi, sparse_vect_index &sv_idx) |
static void | speed_test_bv_index (const bv_index &bvi) |
static void | speed_test_bvs_index (const bvs_index &bvs) |
static void | speed_test_vect_index (const vect_index &vecti) |
static void | speed_test_sv_index (const sparse_vect_index &svi) |
int | main (void) |
Variables | |
const unsigned | index_size = 1000000 |
const unsigned | max_size = 2000000 |
const unsigned | bits_per_vect = 5 |
const unsigned | benchmark_ops = 1000 |
const unsigned | sample_cnt = 250 |
const unsigned | result_set_cnt = 200 |
bm::chrono_taker::duration_map_type | timing_map |
Example: Example: memory consumption techniques.
Definition in file xsample01.cpp.
typedef bm::bvector TBVector |
Definition at line 72 of file xsample01.cpp.
|
static |
Definition at line 395 of file xsample01.cpp.
References bm::bvector< Alloc >::first(), and bm::bvector< Alloc >::iterator_base::valid().
Referenced by convert_bv2sv().
|
static |
Definition at line 281 of file xsample01.cpp.
References bm::bvector< Alloc >::calc_stat(), bv_index::idx_, and bm::bv_statistics::memory_used.
Referenced by main().
|
static |
Definition at line 99 of file xsample01.cpp.
References bm::BM_GAP, and max_size.
Referenced by bm::basic_bmatrix< BV >::construct_row(), bm::basic_bmatrix< BV >::construct_row(), bm::basic_bmatrix< BV >::copy_from(), and generate_bv_index().
Definition at line 303 of file xsample01.cpp.
References bm::serializer< BV >::byte_order_serialization(), bm::bvector< Alloc >::calc_stat(), bm::bvector< Alloc >::compare(), bm::deserialize(), bm::serializer< BV >::gap_length_serialization(), bv_index::idx_, bvs_index::idx_, bm::bv_statistics::max_serialize_mem, bm::serializer< BV >::serialize(), and bm::serializer< BV >::set_compression_level().
Referenced by main().
|
static |
Definition at line 419 of file xsample01.cpp.
References BM_DECLARE_TEMP_BLOCK, bv2delta(), bm::bvector< Alloc >::first(), sparse_vect_index::get_vector(), bv_index::idx_, sparse_vect_index::idx_, bm::sparse_vector< Val, BV >::import(), sparse_vect_index::vect_addr::offset, bm::bvector< Alloc >::opt_compress, bm::sparse_vector< Val, BV >::optimize(), bm::bvector< Alloc >::resize(), bm::sparse_vector< Val, BV >::set(), sparse_vect_index::vect_addr::size, sparse_vect_index::sv_storage1_, sparse_vect_index::sv_storage_, and bm::bvector< Alloc >::iterator_base::valid().
Referenced by main().
|
static |
Definition at line 365 of file xsample01.cpp.
References bm::bvector< Alloc >::count(), bm::bvector< Alloc >::first(), bv_index::idx_, vect_index::idx_, and bm::bvector< Alloc >::iterator_base::valid().
Referenced by main().
void destroy_map | ( | TM & | id_map | ) |
Definition at line 114 of file xsample01.cpp.
References bm::bvector< Alloc >::clear().
Referenced by bv_index::~bv_index().
|
static |
Definition at line 260 of file xsample01.cpp.
References construct_bvector(), generate_random_vector(), bv_index::idx_, and index_size.
Referenced by main().
|
static |
Definition at line 217 of file xsample01.cpp.
References bits_per_vect, max_size, and bm::bvector< Alloc >::set_bit().
Referenced by generate_bv_index().
int main | ( | void | ) |
Definition at line 798 of file xsample01.cpp.
References calc_memory_footprint(), convert_bv2bvs(), convert_bv2sv(), convert_bv2vect(), bm::chrono_taker::ct_ops_per_sec, generate_bv_index(), bm::chrono_taker::print_duration_map(), speed_test_bv_index(), speed_test_bvs_index(), speed_test_sv_index(), speed_test_vect_index(), and timing_map.
|
static |
Definition at line 553 of file xsample01.cpp.
References bm::chrono_taker::add_repeats(), benchmark_ops, bm::BM_GAP, bm::bvector< Alloc >::clear(), bm::bvector< Alloc >::first(), bv_index::idx_, index_size, bm::bvector< Alloc >::optimize(), result_set_cnt, sample_cnt, timing_map, and bm::bvector< Alloc >::iterator_base::valid().
Referenced by main().
|
static |
Definition at line 612 of file xsample01.cpp.
References bm::chrono_taker::add_repeats(), benchmark_ops, BM_DECLARE_TEMP_BLOCK, bm::BM_GAP, bm::bvector< Alloc >::clear(), bm::operation_deserializer< BV >::deserialize(), bm::bvector< Alloc >::first(), bvs_index::idx_, index_size, bm::bvector< Alloc >::optimize(), result_set_cnt, sample_cnt, bm::set_OR, timing_map, and bm::bvector< Alloc >::iterator_base::valid().
Referenced by main().
|
static |
Definition at line 738 of file xsample01.cpp.
References bm::chrono_taker::add_repeats(), benchmark_ops, bm::BM_GAP, bm::bvector< Alloc >::clear(), bm::combine_or(), bm::bvector< Alloc >::end(), bm::bvector< Alloc >::first(), sparse_vect_index::get_vector(), sparse_vect_index::idx_, index_size, bm::bvector< Alloc >::optimize(), result_set_cnt, sample_cnt, timing_map, and bm::bvector< Alloc >::iterator_base::valid().
Referenced by main().
|
static |
Definition at line 676 of file xsample01.cpp.
References bm::chrono_taker::add_repeats(), benchmark_ops, bm::BM_GAP, bm::bvector< Alloc >::clear(), bm::combine_or(), bm::bvector< Alloc >::end(), bm::bvector< Alloc >::first(), vect_index::idx_, index_size, bm::bvector< Alloc >::optimize(), result_set_cnt, sample_cnt, timing_map, and bm::bvector< Alloc >::iterator_base::valid().
Referenced by main().
const unsigned benchmark_ops = 1000 |
Definition at line 62 of file xsample01.cpp.
Referenced by speed_test_bv_index(), speed_test_bvs_index(), speed_test_sv_index(), and speed_test_vect_index().
const unsigned bits_per_vect = 5 |
Definition at line 59 of file xsample01.cpp.
Referenced by generate_random_vector().
const unsigned index_size = 1000000 |
Definition at line 53 of file xsample01.cpp.
Referenced by generate_bv_index(), speed_test_bv_index(), speed_test_bvs_index(), speed_test_sv_index(), and speed_test_vect_index().
const unsigned max_size = 2000000 |
Definition at line 56 of file xsample01.cpp.
Referenced by construct_bvector(), bm::aggregator< BV >::find_effective_sub_block_size(), and generate_random_vector().
const unsigned result_set_cnt = 200 |
Definition at line 68 of file xsample01.cpp.
Referenced by speed_test_bv_index(), speed_test_bvs_index(), speed_test_sv_index(), and speed_test_vect_index().
const unsigned sample_cnt = 250 |
Definition at line 65 of file xsample01.cpp.
Referenced by speed_test_bv_index(), speed_test_bvs_index(), speed_test_sv_index(), and speed_test_vect_index().
bm::chrono_taker::duration_map_type timing_map |
Definition at line 76 of file xsample01.cpp.