27#ifndef EASY3D_CORE_HASH_H
28#define EASY3D_CORE_HASH_H
34#include <easy3d/core/vec.h>
51 static std::hash<T> hasher;
52 uint64_t a = (hasher(value) ^ seed) * 0x9ddfea08eb382d69ULL;
54 uint64_t b = (seed ^ a) * 0x9ddfea08eb382d69ULL;
56 seed = b * 0x9ddfea08eb382d69ULL;
65 template <
typename FT>
79 template <
typename FT>
95 template <
int DIM,
typename FT>
98 for (
int i=0; i<DIM; ++i)
110 template<
typename Iterator>
111 uint64_t
hash(Iterator first, Iterator last) {
113 for (; first != last; ++first) {
126 template<
typename Iterator>
127 void hash(uint64_t &seed, Iterator first, Iterator last) {
128 for (; first != last; ++first) {
Base class for vector types. It provides generic functionality for N dimensional vectors.
Definition vec.h:30
Definition collider.cpp:182
uint64_t hash(const Vec< 2, FT > &value)
Computes the hash value of a 2D vector.
Definition hash.h:66
void hash_combine(uint64_t &seed, T const &value)
Combines a hash value with a seed value.
Definition hash.h:50