Thrill  0.1
TabulationHashing< size, hash_t, prng_t > Class Template Reference

Detailed Description

template<size_t size, typename hash_t = uint32_t, typename prng_t = std::mt19937>
class thrill::common::TabulationHashing< size, hash_t, prng_t >

Tabulation Hashing, see https://en.wikipedia.org/wiki/Tabulation_hashing.

Keeps a table with size * 256 entries of type hash_t, filled with random values. Elements are hashed by treating them as a vector of 'size' bytes, and XOR'ing the values in the data[i]-th position of the i-th table, with i ranging from 0 to size - 1.

Definition at line 219 of file hash.hpp.

#include <hash.hpp>

Public Types

using hash_type = hash_t
 
using prng_type = prng_t
 
using Subtable = std::array< hash_type, 256 >
 
using Table = std::array< Subtable, size >
 

Public Member Functions

 TabulationHashing (size_t seed=0)
 
void init (const size_t seed)
 (re-)initialize the table by filling it with random values More...
 
template<typename T >
hash_type operator() (const T &x) const
 Hash an element. More...
 

Protected Attributes

Table table_
 

Member Typedef Documentation

◆ hash_type

using hash_type = hash_t

Definition at line 222 of file hash.hpp.

◆ prng_type

using prng_type = prng_t

Definition at line 223 of file hash.hpp.

◆ Subtable

using Subtable = std::array<hash_type, 256>

Definition at line 224 of file hash.hpp.

◆ Table

using Table = std::array<Subtable, size>

Definition at line 225 of file hash.hpp.

Constructor & Destructor Documentation

◆ TabulationHashing()

TabulationHashing ( size_t  seed = 0)
inlineexplicit

Definition at line 227 of file hash.hpp.

References seed.

Member Function Documentation

◆ init()

void init ( const size_t  seed)
inline

(re-)initialize the table by filling it with random values

Definition at line 230 of file hash.hpp.

◆ operator()()

hash_type operator() ( const T x) const
inline

Hash an element.

Definition at line 241 of file hash.hpp.

References gen_data::x.

Member Data Documentation

◆ table_

Table table_
protected

Definition at line 253 of file hash.hpp.


The documentation for this class was generated from the following file: