|
ADS
Algorithms and Data Structures
|
The partitioned Elias-Fano representation of Ottaviano and Venturini: a strictly increasing sequence \( x_0 < \cdots < x_{n-1} \) of integers of \( [ 0 , u ) \) cut into blocks of \( B = 128 \) items, each one coded in the cheapest of three ways relative to the end of the block before, so that a sequence with clusters (the lists of an inverted index) takes far fewer bits than the \( 2 + \lceil \log_2( u / n ) \rceil \) per item of Elias-Fano [see EliasFano.h], which ignores its regularities, with the same access() and nextGEQ(). More...
#include "ADS/Contract.h"#include "ADS/external/MappedFile.h"#include "ADS/succinct/BitVector.h"#include <algorithm>#include <array>#include <bit>#include <cstddef>#include <cstdint>#include <span>#include <string_view>#include <vector>#include "ADS/succinct/impl/PartitionedEliasFano.tpp"Go to the source code of this file.
Classes | |
| class | ADS::PartitionedEliasFano |
| a static strictly increasing sequence of integers in blocks, each coded as full, as a vector of bits or by Elias-Fano, with access() and nextGEQ() More... | |
Namespaces | |
| namespace | ADS |
The partitioned Elias-Fano representation of Ottaviano and Venturini: a strictly increasing sequence \( x_0 < \cdots < x_{n-1} \) of integers of \( [ 0 , u ) \) cut into blocks of \( B = 128 \) items, each one coded in the cheapest of three ways relative to the end of the block before, so that a sequence with clusters (the lists of an inverted index) takes far fewer bits than the \( 2 + \lceil \log_2( u / n ) \rceil \) per item of Elias-Fano [see EliasFano.h], which ignores its regularities, with the same access() and nextGEQ().
The block \( j \) holds the items of places \( [ j B , ( j + 1 ) B ) \), \( m \) of them, relative to \( b_j = x_{j B - 1} + 1 \) (0 for the first block): the values \( v = x - b_j \) are in \( [ 0 , u_j ) \) with \( u_j = x_{\mathrm{last}} - b_j + 1 \), and the block is
the kind is a function of \( ( m , u_j ) \). For each block a record of one word (two if the fields do not fit in one) holds \( b_j \) and the place of its code, both relative to those of the first block of its superblock of 16 blocks, the place of the 1 of rank 64 in its code (the high part or the vector) and its kind with \( \ell \) (8 bits, so that a query computes no logarithm); each superblock keeps its \( b \) and its place in full, and a table of buckets gives, for each \( t \), the last superblock whose \( b \) is below \( t 2^s \), one bucket per superblock or so; so
Ottaviano and Venturini also choose the ends of the blocks by an approximate dynamic program on the cost of the codes, which gains a further 10% or so on the lists of an index; the blocks here have the fixed size of their uniform partition.
The contracts [see Contract.h]: the sequence is strictly increasing (an audit) and below \( u \), and access() needs \( i < n \); the audit of the construction is that access() gives back each item, and the postcondition of nextGEQ() is that the items before the place are \( < x \) and the one at it is not. The functions are defined in PartitionedEliasFano.tpp.