File: expl-12.cpp

package info (click to toggle)
libsdsl 2.1.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 3,980 kB
  • sloc: cpp: 42,286; makefile: 1,171; ansic: 318; sh: 201; python: 27
file content (21 lines) | stat: -rw-r--r-- 436 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
#include <sdsl/bit_vectors.hpp>
#include <sdsl/vectors.hpp>

using namespace std;
using namespace sdsl;

int main()
{
    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;
}