59 const unsigned max_coll = 50000;
63 for (
unsigned i = 10; i < max_coll; i += unsigned(rand() % 3))
66 str_vec.emplace_back(str);
71 std::random_device rd;
73 std::shuffle(str_vec.begin(), str_vec.end(), g);
86 for (
const string& s : str_vec)
88 const char* cs = s.c_str();
105 vector<string> str_vec;
116 std::sort(str_vec.begin(), str_vec.end());
118 vector<string>::const_iterator sit = str_vec.begin();
119 str_sv_type::const_iterator it = str_sv.
begin();
120 str_sv_type::const_iterator it_end = str_sv.
end();
121 for (; it != it_end; ++it, ++sit)
126 cerr <<
"Mismatch at:" << s <<
"!=" << *sit << endl;
131 cout <<
"Sort validation Ok." << endl;
133 catch(std::exception& ex)
135 std::cerr << ex.what() << std::endl;
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
#define BM_DECLARE_TEMP_BLOCK(x)
Algorithms for bm::sparse_vector.
string sparse vector based on bit-transposed matrix
pre-processor un-defines to avoid global space pollution (internal)
Bitvector Bit-vector container with runtime compression of bits.
algorithms for sparse_vector scan/search
bool lower_bound_str(const SV &sv, const value_type *str, size_type &pos)
lower bound search for an array position
succinct sparse vector for strings with compression using bit-slicing ( transposition) method
void insert(size_type idx, const value_type *str)
insert the specified element
const_iterator end() const BMNOEXCEPT
Provide const iterator access to the end.
void optimize(bm::word_t *temp_block=0, typename bvector_type::optmode opt_mode=bvector_type::opt_compress, typename str_sparse_vector< CharType, BV, STR_SIZE >::statistics *stat=0)
run memory optimization for all vector planes
const_iterator begin() const BMNOEXCEPT
Provide const iterator access to container content.
bvector_type::size_type size_type
bm::str_sparse_vector< char, bvector_type, 32 > str_sv_type
static void generate_string_set(vector< string > &str_vec)
static void insertion_sort(str_sv_type &str_sv, const vector< string > &str_vec)