BitMagic-C++
|
Example: sparse_vector<> scan search (non-ordered set functionality) More...
#include <iostream>
#include <vector>
#include <chrono>
#include <algorithm>
#include <random>
#include <stdexcept>
#include "bm.h"
#include "bmsparsevec.h"
#include "bmsparsevec_algo.h"
#include "bmtimer.h"
Go to the source code of this file.
Typedefs | |
typedef bm::sparse_vector< bm::id_t, bm::bvector<> > | sparse_vector_u32 |
Functions | |
std::mt19937 | gen (rand_dev()) |
std::uniform_int_distribution | rand_dis (1, value_max) |
static void | generate_test_set (std::vector< unsigned > &vect, bm::bvector<> &bv_null, sparse_vector_u32 &sv) |
static void | vector_search (const std::vector< unsigned > &vect, const bm::bvector<> &bv_null, unsigned value, bm::bvector<> &bv_res) |
void | print_bvector (const bm::bvector<> &bv) |
int | main (void) |
Variables | |
const unsigned | value_max = 1250000 |
const unsigned | test_size = 250000000 |
std::random_device | rand_dev |
bm::chrono_taker::duration_map_type | timing_map |
Example: sparse_vector<> scan search (non-ordered set functionality)
Definition in file svsample06.cpp.
typedef bm::sparse_vector<bm::id_t, bm::bvector<> > sparse_vector_u32 |
Definition at line 46 of file svsample06.cpp.
std::mt19937 gen | ( | rand_dev() | ) |
Referenced by generate_test_set(), and main().
|
static |
Definition at line 73 of file svsample06.cpp.
References bm::sparse_vector< unsigned, bm::bvector<> >::back_insert_iterator, gen(), bm::sparse_vector< Val, BV >::get_back_inserter(), rand_dis(), bm::bvector< Alloc >::reset(), and test_size.
Referenced by main().
int main | ( | void | ) |
Definition at line 133 of file svsample06.cpp.
References bm::sparse_vector< Val, BV >::begin(), bm::BM_GAP, bm::combine_or(), bm::bvector< Alloc >::compare(), bm::sparse_vector< unsigned, bm::bvector<> >::const_iterator, bm::chrono_taker::ct_ops_per_sec, bm::sparse_vector< Val, BV >::end(), bm::bvector< Alloc >::end(), bm::sparse_vector_scanner< SV >::find_eq(), gen(), generate_test_set(), bm::bvector< Alloc >::init(), bm::sparse_vector_scanner< SV >::invert(), print_bvector(), bm::chrono_taker::print_duration_map(), rand_dis(), bm::sparse_vector< Val, BV >::set(), bm::bvector< Alloc >::set_bit_no_check(), bm::bvector< Alloc >::test(), bm::use_null, and vector_search().
|
inline |
Definition at line 122 of file svsample06.cpp.
References bm::bvector< Alloc >::count(), bm::bvector< Alloc >::first(), and bm::bvector< Alloc >::iterator_base::valid().
Referenced by main().
std::uniform_int_distribution rand_dis | ( | 1 | , |
value_max | |||
) |
Referenced by generate_test_set(), and main().
|
static |
Definition at line 106 of file svsample06.cpp.
References bm::bvector< Alloc >::init(), and bm::bvector< Alloc >::set_bit_no_check().
Referenced by main().
std::random_device rand_dev |
Definition at line 60 of file svsample06.cpp.
const unsigned test_size = 250000000 |
Definition at line 54 of file svsample06.cpp.
Referenced by generate_test_set().
bm::chrono_taker::duration_map_type timing_map |
Definition at line 65 of file svsample06.cpp.
const unsigned value_max = 1250000 |
Definition at line 53 of file svsample06.cpp.