forked from foudrer/Sux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
simple_select_zero_half.h
48 lines (41 loc) · 1.38 KB
/
simple_select_zero_half.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Sux: Succinct data structures
*
* Copyright (C) 2007-2013 Sebastiano Vigna
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef simple_select_zero_half_h
#define simple_select_zero_half_h
using namespace std;
#include <stdint.h>
#include "macros.h"
#include "select.h"
class simple_select_zero_half {
private:
const uint64_t *bits;
int64_t *inventory;
uint64_t num_words, inventory_size, num_ones;
public:
simple_select_zero_half();
simple_select_zero_half( const uint64_t * const bits, const uint64_t num_bits );
~simple_select_zero_half();
uint64_t select_zero( const uint64_t rank );
uint64_t select_zero( const uint64_t rank, uint64_t * const next );
// Just for analysis purposes
void print_counts();
uint64_t bit_count();
};
#endif