forked from simongog/sdsl-lite
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexpl-25.cpp
More file actions
Latest commit
19 lines (16 loc) · 535 Bytes
/
Copy pathexpl-25.cpp
File metadata and controls
19 lines (16 loc) · 535 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include<sdsl/bp_support.hpp>
#include<iostream>
usingnamespacestd;
usingnamespacesdsl;
intmain()
{
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
// ( ( ( ) ( ) ) ( ) ( ( ( ) ( ) ) ( ) ) )
bit_vector b = {1,1,1,0,1,0,0,1,0,1,1,1,0,1,0,0,1,0,0,0};
bp_support_sada<> bps(&b); // <- pointer to b
for (size_t i=0; i < b.size(); ++i)
cout << bps.excess(i)<< "";
cout << endl;
cout << bps.rank(0) << ", "// inclusive rank for BPS!!!
<< bps.select(4) << endl;
}