forked from simongog/sdsl-lite
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexpl-08.cpp
More file actions
Latest commit
22 lines (20 loc) · 617 Bytes
/
Copy pathexpl-08.cpp
File metadata and controls
22 lines (20 loc) · 617 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include<iostream>
#include<sdsl/bit_vectors.hpp>
usingnamespacestd;
usingnamespacesdsl;
intmain()
{
bit_vector b = bit_vector(8000, 0);
for (size_t i=0; i < b.size(); i+=100)
b[i] = 1;
sd_vector<> sdb(b);
sd_vector<>::rank_1_type sdb_rank(&sdb);
for (size_t i=0; i<=sdb.size(); i+= sdb.size()/4)
cout << "(" << i << ", " << sdb_rank(i) << ") ";
cout << endl;
rrr_vector<> rrrb(b);
rrr_vector<>::rank_1_type rrrb_rank(&rrrb);
for (size_t i=0; i<=rrrb.size(); i+= rrrb.size()/4)
cout << "(" << i << ", " << rrrb_rank(i) << ") ";
cout << endl;
}