|
ADS
Algorithms and Data Structures
|
the simple tabulation hashing of the keys of 64 bits More...
#include <ADS/dictionary/RandomHashing.h>
Public member functions | |
| TabulationHash (std::uint64_t seed=1) | |
| the 8 tables of 256 random words, from the seed | |
| std::uint64_t | operator() (std::uint64_t x) const |
| the XOR of the words of the 8 bytes of \( x \) | |
| std::size_t | place (std::uint64_t x, std::size_t m) const |
| the place of \( x \) in a table of \( m = 2^d \) places, the \( d \) most significant bits of its hash, as the LinearHashTable of section 5.2.3 of Morin's book takes them [see PlaceHash in TableSize.h] | |
the simple tabulation hashing of the keys of 64 bits
|
explicit |
the 8 tables of 256 random words, from the seed
|
nodiscard |
the XOR of the words of the 8 bytes of \( x \)
In pseudocode (the simple tabulation of Carter and Wegman, beyond the book), \( x_0 , \ldots , x_7 \) the bytes of \( x \):
\[\class{pseudocode}{\begin{array}{r@{\quad}l} 1 & \textbf{function}\ \mathrm{tabulation}( x ) \cr 2 & \quad \textbf{return}\ T_0[ x_0 ] \oplus T_1[ x_1 ] \oplus \cdots \oplus T_7[ x_7 ] \end{array}} \]
|
nodiscard |
the place of \( x \) in a table of \( m = 2^d \) places, the \( d \) most significant bits of its hash, as the LinearHashTable of section 5.2.3 of Morin's book takes them [see PlaceHash in TableSize.h]