Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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

using hash_type = hash_t

Definition at line 222 of file hash.hpp.

using prng_type = prng_t

Definition at line 223 of file hash.hpp.

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

Definition at line 224 of file hash.hpp.

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

Definition at line 225 of file hash.hpp.

Constructor & Destructor Documentation

TabulationHashing ( size_t  seed = 0)
inlineexplicit

Definition at line 227 of file hash.hpp.

References TabulationHashing< size, hash_t, prng_t >::init(), and seed.

Member Function Documentation

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.

References TabulationHashing< size, hash_t, prng_t >::table_.

Referenced by TabulationHashing< size, hash_t, prng_t >::TabulationHashing().

hash_type operator() ( const T x) const
inline

Hash an element.

Definition at line 241 of file hash.hpp.

References TabulationHashing< size, hash_t, prng_t >::table_, and gen_data::x.

Member Data Documentation


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