|
ADS
Algorithms and Data Structures
|
The streams of bits on which the integer codes are written and read [see IntegerCodes.h]: BitWriter appends bits to a BitVector [see BitVector.h] and BitReader reads them back from a place that moves forward, both in \( O( 1 ) \) time per field of up to 64 bits. More...
#include "ADS/Contract.h"#include "ADS/Portable.h"#include "ADS/combinatorial/Bitwise.h"#include "ADS/succinct/BitVector.h"#include <bit>#include <cstddef>#include <cstdint>#include <type_traits>#include <utility>#include "ADS/succinct/impl/BitStream.tpp"Go to the source code of this file.
Classes | |
| class | ADS::BitWriter |
| a stream of bits written at its end, on a BitVector More... | |
| class | ADS::BitReader |
| a stream of bits read forward from a place of a BitVector, which must outlive the reader More... | |
Namespaces | |
| namespace | ADS |
The streams of bits on which the integer codes are written and read [see IntegerCodes.h]: BitWriter appends bits to a BitVector [see BitVector.h] and BitReader reads them back from a place that moves forward, both in \( O( 1 ) \) time per field of up to 64 bits.
Writing the codes into words of 64 bits, rather than bytes, is what the fast decoders of the literature do (e.g., the bit streams of the WebGraph framework of Boldi and Vigna and of the succinct libraries): a codeword of up to 64 bits spans at most two words, and the unary part is decoded with one instruction per word.
The contracts [see Contract.h]: a field has at most 64 bits and its value fits in them, and a reader never reads past the end of its bits. The functions are defined in BitStream.tpp.