32#ifndef MADNESS_WORLD_WORLDHASH_H__INCLUDED
33#define MADNESS_WORLD_WORLDHASH_H__INCLUDED
132#include <type_traits>
155 inline typename std::enable_if<std::is_fundamental<T>::value &&
156 ((
sizeof(
T)%
sizeof(uint32_t)) == 0),
160 result =
hashword(
reinterpret_cast<const uint32_t*
>(&t),
161 std::integral_constant<std::size_t,
sizeof(
T)/
sizeof(uint32_t)>::value, 0
u);
171 inline typename std::enable_if<std::is_fundamental<T>::value &&
172 ((
sizeof(
T)%
sizeof(uint32_t)) != 0),
176 result =
hashlittle(
reinterpret_cast<const void*
>(&t),
sizeof(
T), 0
u);
185 template <
typename T>
187 const unsigned long n =
reinterpret_cast<unsigned long>(t);
196 template <typename T, typename = std::enable_if_t<std::is_same_v<decltype(std::declval<const T&>().hash()),
hashT>>>
207 template <
typename T>
214 template <
typename T,
typename R>
232 template <
typename T>
249 seed ^= hash + 0x9e3779b9 + (seed<<6) + (seed>>2);
265 template <
typename T,
typename R>
282 for(; first != last; ++first)
306 template <
class T, std::
size_t n>
318 template <
class T, std::
size_t n>
332 inline typename std::enable_if<std::is_fundamental<T>::value >
::type
334 const std::size_t bytes = n *
sizeof(
T);
335 if((bytes %
sizeof(uint32_t)) == 0)
336 seed =
hashword(
reinterpret_cast<const uint32_t *
>(t), bytes/
sizeof(uint32_t), seed);
338 seed =
hashlittle(
static_cast<const void *
>(t), bytes, seed);
348 inline typename std::enable_if<!std::is_fundamental<T>::value >
::type
366 template <
typename T>
auto T(World &world, response_space &f) -> response_space
Definition global_functions.cc:34
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval)
Definition lookup3.c:177
uint32_t hashlittle(const void *key, size_t length, uint32_t initval)
Definition lookup3.c:240
static const double v
Definition hatom_sf_dirac.cc:20
static double u(double r, double c)
Definition he.cc:20
static const double length
Definition hedft.cc:48
Macros and tools pertaining to the configuration of MADNESS.
void combine_hash(hashT &seed, hashT hash)
Internal use only.
Definition worldhash.h:248
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
void hash_range(hashT &seed, It first, It last)
Definition worldhash.h:280
void hash_combine(hashT &seed, const T &v)
Combine hash values.
Definition worldhash.h:260
std::size_t hashT
The hash value type.
Definition worldhash.h:145
std::string type(const PairType &n)
Definition PNOParameters.h:18
madness::hashT hash_value(const std::array< T, N > &a)
Hash std::array with madness hash.
Definition array_addons.h:78
static const long k
Definition rk.cc:44
Hash functor.
Definition worldhash.h:233
hashT operator()(const T &t) const
Hashing function wrapper.
Definition worldhash.h:239