36 #ifndef MADNESS_WORLD_WORLDHASH_H__INCLUDED
37 #define MADNESS_WORLD_WORLDHASH_H__INCLUDED
139 uint32_t
hashword(
const uint32_t *k,
size_t length, uint32_t initval);
140 uint32_t
hashlittle(
const void *key,
size_t length, uint32_t initval);
159 ((
sizeof(
T)%
sizeof(uint32_t)) == 0),
163 result =
hashword(reinterpret_cast<const uint32_t*>(&t),
175 ((
sizeof(
T)%
sizeof(uint32_t)) != 0),
179 result =
hashlittle(reinterpret_cast<const void*>(&t),
sizeof(
T), 0u);
188 template <
typename T>
190 const unsigned long n =
reinterpret_cast<unsigned long>(t);
199 template <
typename T>
200 inline typename enable_if_c<!(std::is_fundamental<T>::value ||
211 template <
typename T>
231 template <
typename T>
248 seed ^= hash + 0x9e3779b9 + (seed<<6) + (seed>>2);
273 for(; first != last; ++first)
297 template <
class T, std::
size_t n>
309 template <
class T, std::
size_t n>
323 inline typename enable_if<std::is_fundamental<T> >::type
325 const std::size_t bytes = n *
sizeof(
T);
326 if((bytes %
sizeof(uint32_t)) == 0)
327 seed =
hashword(reinterpret_cast<const uint32_t *>(t), bytes/
sizeof(uint32_t), seed);
329 seed =
hashlittle(static_cast<const void *>(t), bytes, seed);
339 inline typename disable_if<std::is_fundamental<T> >::type
360 #endif // MADNESS_WORLD_WORLDHASH_H__INCLUDED
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval)
Definition: lookup3.c:177
Grossly simplified Boost-like type traits and templates.
hashT operator()(const T &t) const
Hashing function wrapper.
Definition: worldhash.h:238
is_pointer::value will be true if T is a pointer type
Definition: type_traits_bits.h:69
const T1 &f1 return GTEST_2_TUPLE_() T(f0, f1)
void combine_hash(hashT &seed, hashT hash)
Internal use only.
Definition: worldhash.h:247
uint32_t hashlittle(const void *key, size_t length, uint32_t initval)
Definition: lookup3.c:240
void hash_range(hashT &seed, It first, It last)
Combine the hash values of an iterator range.
Definition: worldhash.h:271
madness::hashT hash_value(const std::array< T, N > &a)
Hash std::array with madness::Hash.
Definition: array.h:62
void hash_combine(hashT &seed, const T &v)
Combine hash values.
Definition: worldhash.h:259
enable_if_c from Boost for conditionally instantiating templates based on type
Definition: enable_if.h:46
std::size_t hashT
The hash value type.
Definition: worldhash.h:148
Definition: integral_constant.h:7
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
is_array::value will be true if T is an array type
Definition: type_traits_bits.h:61
Hash functor.
Definition: shared_ptr_bits.h:32