53 const unsigned max_coll = 50000;
56 for (
unsigned i = 10; i < max_coll; i += rand() % 3)
63 std::random_device rd;
65 std::shuffle(vec.begin(), vec.end(), g);
79 for (
const unsigned u : vec)
103 std::sort(vec.begin(), vec.end());
105 vector<unsigned>::const_iterator vit = vec.begin();
108 for (; it != it_end; ++it, ++vit)
113 cerr <<
"Mismatch at:" << u <<
"!=" << *vit << endl;
118 cout <<
"Sort validation Ok." << endl;
120 catch(std::exception& ex)
122 std::cerr << ex.what() << std::endl;
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
void optimize(bm::word_t *temp_block=0, typename bvector_type::optmode opt_mode=bvector_type::opt_compress, typename sparse_vector< Val, BV >::statistics *stat=0)
run memory optimization for all vector plains
void insert(size_type idx, value_type v)
insert specified element into container
Sparse constainer sparse_vector<> for integer types using bit-transposition transform.
algorithms for sparse_vector scan/seach
static void generate_set(vector< unsigned > &vec)
sparse vector with runtime compression using bit transposition method
const_iterator begin() const
Provide const iterator access to container content.
static void insertion_sort(sparse_vector_u32 &sv, const vector< unsigned > &vec)
bm::sparse_vector< bm::id_t, bm::bvector<> > sparse_vector_u32
bool lower_bound(const SV &sv, const typename SV::value_type val, typename SV::size_type &pos)
lower bound search for an array position
bvector_type::size_type size_type
const_iterator end() const
Provide const iterator access to the end.
Algorithms for sparse_vector<>