Example of how to use bm::str_sparse_vector<> - succinct container for bit-transposed string collections
- See also
- bm::str_sparse_vector
#include <iostream>
#include <string>
#include <vector>
using namespace std;
{
try
{
const char* s0 = "asz1234";
std::string str1 = "aqw1234";
std::string str3 = "54z";
std::string str00 = "00";
std::cout <<
"sv size()=" << str_sv.
size() << endl;
{
}
{
const char* s = str_sv[i];
cout << i << ":" << s << endl;
}
cout << "----" << endl;
{
for (; it != it_end; ++it)
{
cout << *it << endl;
}
}
}
catch(std::exception& ex)
{
std::cerr << ex.what() << std::endl;
return 1;
}
return 0;
}
void optimize(bm::word_t *temp_block=0, typename bvector_type::optmode opt_mode=bvector_type::opt_compress, typename str_sparse_vector< CharType, BV, MAX_STR_SIZE >::statistics *stat=0)
run memory optimization for all vector plains