60 const unsigned max_coll = 50000;
64 for (
unsigned i = 10; i < max_coll; i += unsigned(rand() % 3))
67 str_vec.emplace_back(str);
72 std::random_device rd;
74 std::shuffle(str_vec.begin(), str_vec.end(), g);
87 for (
const string& s : str_vec)
89 const char* cs = s.c_str();
106 vector<string> str_vec;
117 std::sort(str_vec.begin(), str_vec.end());
119 vector<string>::const_iterator sit = str_vec.begin();
122 for (; it != it_end; ++it, ++sit)
127 cerr <<
"Mismatch at:" << s <<
"!=" << *sit << endl;
132 cout <<
"Sort validation Ok." << endl;
134 catch(std::exception& ex)
136 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
Const iterator to do quick traverse of the sparse vector.
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)