56#ifndef DOXYGEN_SHOULD_SKIP_THIS
70 for (
Size nbb = nb; nbb >
Size(1); ++i, nbb >>= 1) {};
72 return ((
Size(1) << i) < nb ? i +
Size(1) : i);
81 const char* char_ptr = key.c_str();
82 const Size* int_ptr = (
const Size*)char_ptr;
84 for (; size >=
sizeof(
Size); size -=
sizeof(
Size), ++int_ptr) {
88 for (char_ptr = (
const char*)int_ptr; size !=
Size(0); --size, ++char_ptr) {
97 return castToSize(key) & this->hash_mask_;
106 for (
Size i =
Size(0); i < size; ++i)
107 h += i *
Size(key[i]);
123 for (
Size i =
Size(0), j =
Size(key.size()); i < j; ++i)
static Size castToSize(const Debug &key)
Returns the value of a key as a Size.
virtual Size operator()(const Debug &key) const override final
Computes the hashed value of a key.
virtual Size operator()(const std::string &key) const override final
Computes the hashed value of a key.
static Size castToSize(const std::string &key)
Returns the value of a key as a Size.
This class should be useless as only its specializations should be used.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
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.
Classes providing basic hash functions for hash tables.
gum is the global namespace for all aGrUM entities
static constexpr Size gold