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