#pragma once #include "glm/glm.hpp" #include // Hash function for Eigen matrix and vector. // The code is from `hash_combine` function of the Boost library. See // http://www.boost.org/doc/libs/1_55_0/doc/html/hash/reference.html#boost.hash_combine . template struct std::hash> { auto operator() (const glm::vec& key) const { auto seed = std::size_t{}; for (glm::length_t i{}; i != L; ++i) { seed ^= std::hash{}(key[i]) + 0x9e3779b9 + (seed << 6) + (seed >> 2); } return seed; } };