27#ifndef EASY3D_CORE_HASH_H
28#define EASY3D_CORE_HASH_H
51 inline void hash_combine(uint64_t &seed, T
const& value) {
52 static std::hash<T> hasher;
53 seed ^= hasher(value) + 0x9e3779b9 + (seed<<6) + (seed>>2);
65 static std::hash<T> hasher;
66 uint64_t a = (hasher(value) ^ seed) * 0x9ddfea08eb382d69ULL;
68 uint64_t b = (seed ^ a) * 0x9ddfea08eb382d69ULL;
70 seed = b * 0x9ddfea08eb382d69ULL;
75 template <
typename FT>
84 template <
typename FT>
95 template <
int DIM,
typename FT>
inline
98 for (
int i=0; i<DIM; ++i)
105 template<
typename Iterator>
106 inline uint64_t
hash(Iterator first, Iterator last) {
108 for (; first != last; ++first) {
116 template<
typename Iterator>
117 inline void hash(uint64_t &seed, Iterator first, Iterator last) {
118 for (; first != last; ++first) {
Base class for vector types. It provides generic functionality for N dimensional vectors.
Definition: vec.h:34
Definition: collider.cpp:182
uint64_t hash(const Vec< 2, FT > &value)
Computes the hash value of a 2D vector.
Definition: hash.h:76
void hash_combine(uint64_t &seed, T const &value)
std::size_t has 64 bits on most systems, but 32 bits on 32-bit Windows. To make the same code robustl...
Definition: hash.h:64