17#ifndef AGX_HASHFUNCTIONS_H
18#define AGX_HASHFUNCTIONS_H
73 return h1 ^ (h2 + 0x9e3779b9 + (h1<<6) + (h1>>2));
76 template <
typename T1,
typename T2>
84 template<
typename T1,
typename T2>
102 key = ~key + (key << 15);
103 key = key ^ (key >> 12);
104 key = key + (key << 2);
105 key = key ^ (key >> 4);
107 key = key ^ (key >> 16);
128 key = (~key) + (key << 18);
129 key = key ^ (key >> 31);
131 key = key ^ (key >> 11);
132 key = key + (key << 6);
133 key = key ^ (key >> 22);
151 struct HashFn<size_t>
163 template <
typename T>
178 template <
typename T>
181 UInt32 hashValue = startValue;
183 for (
UInt32 i = 0; i < key.length(); i++)
184 hashValue = 37 * hashValue + (
UInt32)key[i];
218 hashValue = 37 * hashValue + (
UInt32)(*key++);
227 return strcmp(key1, key2) == 0;
232 return strcmp(key1, key2) == 0;
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
UInt32 hash(const T &key)
UInt32 stringHash(const T &key, UInt32 startValue=0)
AGXCORE_EXPORT void splitHashKey(agx::UInt64 key, agx::UInt32 &id1, agx::UInt32 &id2)
AGXCORE_EXPORT agx::UInt64 buildHashKey(agx::UInt32 id1, agx::UInt32 id2)
bool hashKeyEqual(const T1 &key1, const T2 &key2)
AGXCORE_EXPORT bool hashKeyContains(agx::UInt64 key, agx::UInt32 id)
UInt32 operator()(Int32 key) const
UInt32 operator()(Int64 key) const
UInt32 operator()(const PtrT key) const
UInt32 operator()(UInt32 key) const
UInt32 operator()(UInt64 key) const
UInt32 operator()(const agx::String &key) const
UInt32 operator()(const char *key) const
UInt32 operator()(const std::pair< T1, T2 > &key) const
UInt32 operator()(const std::string &key) const
UInt32 operator()(const T &key) const