33 #ifndef DOXYGEN_SHOULD_SKIP_THIS 47 for (
Size nbb = nb; nbb >
Size(1); ++i, nbb >>= 1) {};
49 return ((
Size(1) << i) < nb ? i +
Size(1) : i);
58 const char* char_ptr = key.c_str();
59 const Size* int_ptr = (
const Size*)char_ptr;
61 for (; size >=
sizeof(
Size); size -=
sizeof(
Size), ++int_ptr) {
65 for (char_ptr = (
const char*)int_ptr; size !=
Size(0); --size, ++char_ptr) {
74 return castToSize(key) & this->_hash_mask;
81 HashFunc< std::vector< Idx > >::castToSize(
const std::vector< Idx >& key) {
84 for (
Size i =
Size(0); i < size; ++i)
85 h += i *
Size(key[i]);
91 INLINE
Size HashFunc< std::vector< Idx > >::
92 operator()(
const std::vector< Idx >& key)
const {
102 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.
Classes providing basic hash functions for hash tables.
gum is the global namespace for all aGrUM entities
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.