36 #ifndef DOXYGEN_SHOULD_SKIP_THIS 50 for (
Size nbb = nb; nbb >
Size(1); ++i, nbb >>= 1) {};
52 return ((
Size(1) << i) < nb ? i +
Size(1) : i);
61 const char* char_ptr = key.c_str();
62 const Size* int_ptr = (
const Size*)char_ptr;
64 for (; size >=
sizeof(
Size); size -=
sizeof(
Size), ++int_ptr) {
68 for (char_ptr = (
const char*)int_ptr; size !=
Size(0); --size, ++char_ptr) {
77 return castToSize(key) & this->_hash_mask;
84 HashFunc< std::vector< Idx > >::castToSize(
const std::vector< Idx >& key) {
87 for (
Size i =
Size(0); i < size; ++i)
88 h += i *
Size(key[i]);
94 INLINE
Size HashFunc< std::vector< Idx > >::
95 operator()(
const std::vector< Idx >& key)
const {
105 for (
Size i =
Size(0), j =
Size(key.size()); i < j; ++i)
unsigned int __hashTableLog2(const Size nb)
Returns the size in bits - 1 necessary to store the smallest power of 2 greater than or equal to nb...
static constexpr Size gold
static Size castToSize(const std::string &key)
Returns the value of a key as a Size.
virtual Size operator()(const std::string &key) const override final
Computes the hashed value of a key.
virtual Size operator()(const Debug &key) const override final
Computes the hashed value of a key.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
static Size castToSize(const Debug &key)
Returns the value of a key as a Size.
std::size_t Size
In aGrUM, hashed values are unsigned long int.