42 std::unique_ptr<bm::bvector<>::rs_index_type>
44 bv.build_rs_index(rs_idx.get());
48 auto r1 = bv.rank(20, *rs_idx);
49 std::cout << r1 << std::endl;
51 r1 = bv.rank(21, *rs_idx);
52 std::cout << r1 << std::endl;
54 r1 = bv.rank(30, *rs_idx);
55 std::cout << r1 << std::endl;
61 bool found = bv.select(2, pos, *rs_idx);
63 std::cout << pos << std::endl;
65 std::cout <<
"Rank not found." << std::endl;
67 found = bv.
select(2, pos, *rs_idx);
69 std::cout << pos << std::endl;
71 std::cout <<
"Rank not found." << std::endl;
73 found = bv.
select(5, pos, *rs_idx);
75 std::cout << pos << std::endl;
77 std::cout <<
"Rank not found." << std::endl;
80 catch(std::exception& ex)
82 std::cerr << ex.what() << std::endl;
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
rs_index< allocator_type > rs_index_type
bool select(size_type rank, size_type &pos, const rs_index_type &rs_idx) const
select bit-vector position for the specified rank(bitcount)