|
ADS
Algorithms and Data Structures
|
The dynamic PGM-index of Ferragina and Vinciguerra, beyond the book: an ordered map from arithmetic keys to values, with insertions and removals, made of static PGM-indices [see PGMIndex.h] by the logarithmic method of Bentley and Saxe (see The PGM-index compressed and dynamic). More...
#include "ADS/Contract.h"#include "ADS/dictionary/FastHash.h"#include "ADS/memory/Prefetch.h"#include "ADS/search/PGMIndex.h"#include "ADS/set/BlockedBloomFilter.h"#include <algorithm>#include <cstddef>#include <cstdint>#include <optional>#include <type_traits>#include <utility>#include <vector>#include "ADS/search/impl/DynamicPGMIndex.tpp"Go to the source code of this file.
Classes | |
| class | ADS::DynamicPGMIndex< K, V, E, B, I > |
| the ordered map from the arithmetic keys K to the values V of the dynamic PGM-index, with the error \( \epsilon = E \) in the levels, the ratio \( B \) of the sizes of two levels and the least capacity \( I \) of a level with a PGM-index More... | |
Namespaces | |
| namespace | ADS |
The dynamic PGM-index of Ferragina and Vinciguerra, beyond the book: an ordered map from arithmetic keys to values, with insertions and removals, made of static PGM-indices [see PGMIndex.h] by the logarithmic method of Bentley and Saxe (see The PGM-index compressed and dynamic).
The pairs lie in a buffer of \( b_0 = 128 \) pairs, sorted, and in levels \( L_1 , L_2 , \ldots \), the level \( L_i \) a sorted array of at most \( b_0 B^i \) pairs, each key at most once per level; a key may be in several levels, and its pair in the newest one, the buffer first and then by increasing \( i \), is the one that counts. A removal is the insertion of a tombstone, a pair that marks the key as absent. An insertion that finds the buffer full merges it, with the new pair, into the first level \( L_t \) that has room for it and for the levels before it, merging those too (the newest pair of each key kept); the tombstones are dropped when \( L_t \) is the last level, since no older pair is left for them to hide. Hence:
The layout, which decides the constants:
The number of distinct keys is not kept: it would cost a lookup per insertion; entries() counts the pairs stored, tombstones and older pairs included.
The contracts [see Contract.h]: \( B \ge 2 \), the pairs of the constructor sorted by key with no key twice (an audit). The functions are defined in DynamicPGMIndex.tpp.