tudocomp
– The TU Dortmund Compression Framework
|
Implements a rank data structure for a BitVector. More...
#include <Rank.hpp>
Public Member Functions | |
Rank () | |
Default constructor. More... | |
Rank (const Rank &other) | |
Copy constructor. More... | |
Rank (Rank &&other) | |
Move constructor. More... | |
Rank & | operator= (const Rank &other) |
Copy assignment. More... | |
Rank & | operator= (Rank &&other) |
Move assignment. More... | |
Rank (const BitVector &bv) | |
Constructs the rank data structure for the given bit vector. More... | |
size_t | rank1 (size_t x) const |
Counts the amount of 1-bits from the beginning of the bit vector up to (including) the given position. More... | |
size_t | rank1 (size_t x, size_t y) const |
Counts the amount of 1-bits in the given interval (borders included) of the bit vector. More... | |
size_t | operator() (size_t x) const |
size_t | operator() (size_t x, size_t y) const |
size_t | rank0 (size_t x) const |
Counts the amount of 0-bits from the beginning of the bit vector up to (including) the given position. More... | |
size_t | rank0 (size_t x, size_t y) const |
Counts the amount of 0-bits in the given interval (borders included) of the bit vector. More... | |
Static Public Attributes | |
static constexpr size_t | block_size |
The size of a block in bits. More... | |
Implements a rank data structure for a BitVector.
The data structure follows a block / superblock principle. Blocks are always of fixed size (e.g. 64 bits), the size of a superblock is the squared block size.
The structure supports both rank1 and rank0 queries.
|
inline |
|
inline |
Constructs the rank data structure for the given bit vector.
Note that changes to the bit vector after construction of this data structure will cause the rank operations to not work correctly anymore. In other words, this data structure is static.
bv | the underlying bit vector |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
The size of a block in bits.