#include <iostream>
#include <vector>
using namespace std;
template<
typename SV>
void PrintSV(
const SV& sv)
{
typename SV::const_iterator it = sv.begin();
typename SV::const_iterator it_end = sv.end();
for (; it != it_end; ++it)
{
if (it.is_null())
cout << "NULL";
else
cout << *it;
cout << ", ";
}
cout << endl;
}
{
try
{
{
bit = 10;
bit = 11;
bit.add_null();
bit = 13;
bit = 14;
bit.add_null(2);
bit = 256;
bit.flush();
}
{
rsc_sparse_vector_u32::const_iterator it =
if (it.valid())
{
do
{
auto v = it.value();
if (it.is_null())
cout << "NULL";
else
cout << v;
cout << ", ";
} while (it.advance());
cout << endl;
it.go_to(3);
cout << it.value() << endl;
}
}
}
catch(std::exception& ex)
{
std::cerr << ex.what() << std::endl;
return 1;
}
return 0;
}
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
Sparse constainer sparse_vector<> for integer types using bit-transposition transform.
Compressed sparse container rsc_sparse_vector<> for integer types.
pre-processor un-defines to avoid global space pollution (internal)
back_insert_iterator get_back_inserter()
void sync(bool force)
Re-calculate rank-select index for faster access to vector.
const_iterator get_const_iterator(size_type idx) const BMNOEXCEPT
Get const_itertor re-positioned to specific element.
succinct sparse vector with runtime compression using bit-slicing / transposition method
bm::sparse_vector< unsigned, bm::bvector<> > sparse_vector_u32
bm::rsc_sparse_vector< unsigned, sparse_vector_u32 > rsc_sparse_vector_u32
void PrintSV(const SV &sv)
Print sparse vector content.