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;
66 auto r1c = bv.rank_corrected(31, *rs_idx);
67 std::cout << r1c << std::endl;
68 r1c = bv.rank_corrected(32, *rs_idx);
69 std::cout << r1c << std::endl;
70 r1c = bv.rank_corrected(33, *rs_idx);
71 std::cout << r1c << std::endl;
77 bool found = bv.
select(2, pos, *rs_idx);
79 std::cout << pos << std::endl;
81 std::cout <<
"Rank not found." << std::endl;
83 found = bv.
select(2, pos, *rs_idx);
85 std::cout << pos << std::endl;
87 std::cout <<
"Rank not found." << std::endl;
89 found = bv.
select(5, pos, *rs_idx);
91 std::cout << pos << std::endl;
93 std::cout <<
"Rank not found." << std::endl;
96 catch(std::exception& ex)
98 std::cerr << ex.what() << std::endl;
bool select(size_type rank, size_type &pos, const rs_index_type &rs_idx) const BMNOEXCEPT
select bit-vector position for the specified rank(bitcount)