#include <iostream>
#include <vector>
#include <cassert>
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 (size_t i = 0; it != it_end; ++it, ++i)
{
if (!it.is_null())
cout << i << ": " << *it << ", ";
}
cout << endl;
}
{
try
{
csv1.sync();
bv1.clear();
csv1.set(100, 1);
csv1.set(20, 1);
csv1.inc(10);
csv1.inc(65536, 1);
assert(csv1.in_sync());
csv1.gather(&values[0], &idx[0], &idx_buf[0], req_size,
bm::BM_UNKNOWN);
for (size_t i = 0; i < req_size; ++i)
{
auto ix = idx[i];
cout << "[" << ix << "] = " << "NULL" << endl;
else
cout << "[" << ix << "] = " << values[i] << 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)
Bitvector Bit-vector container with runtime compression of bits.
bvector_size_type size_type
succinct sparse vector with runtime compression using bit-slicing / transposition method
@ BM_UNKNOWN
sort order unknown
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 not NULL elements.