aGrUM  0.16.0
tupleHashFunc.cpp
Go to the documentation of this file.
1 
29 // =========================================================================
31 // =========================================================================
32 
33 
34 namespace gum {
35 
36  // Returns the value of a key as a Size.
37  Size HashFunc< std::tuple< unsigned int, unsigned int, unsigned int > >::
38  castToSize(
39  const std::tuple< unsigned int, unsigned int, unsigned int >& key) {
40  return HashFuncConst::pi * Size(std::get< 0 >(key)) * Size(2)
41  * Size(std::get< 1 >(key)) * Size(3) * Size(std::get< 2 >(key));
42  }
43 
44  // the hash function for tuple (unsigned int, unsigned int, unsigned int)
46  operator()(
47  const std::tuple< unsigned int, unsigned int, unsigned int >& key) const {
48  return (castToSize(key) * HashFuncConst::gold) & this->_hash_mask;
49  }
50 
51 } // namespace gum
static constexpr Size pi
Definition: hashFunc.h:78
static constexpr Size gold
Definition: hashFunc.h:76
Class template representing hashing function of LpCol.
Definition: hashFunc.h:471
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48