File: expl-02.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 (18 lines) | stat: -rw-r--r-- 441 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <sdsl/vectors.hpp>

using namespace std;
using namespace sdsl;

int main()
{
    int_vector<> v(10*(1<<20));
    for (size_t i=0; i<10; ++i)
        for (size_t j=0; j < 1U<<20; ++j)
            v[i*(1<<20)+j] = j;
    cout << size_in_mega_bytes(v) << endl;
    util::bit_compress(v);
    cout << size_in_mega_bytes(v) << endl;
    enc_vector<coder::comma<>> ev(v);
    cout << size_in_mega_bytes(ev) << endl;
}