11 template <
typename T1,
typename T2>
12 size_t operator()(
const std::pair<T1, T2> &p)
const noexcept
14 auto hash1 = std::hash<T1>{}(p.first);
15 auto hash2 = std::hash<T2>{}(p.second);
24 inline size_t HashPair::operator()<int,
int>(
const std::pair<int, int> &p)
const noexcept
26 size_t h = (size_t(p.first) << 32) +
size_t(p.second);
33 template <
typename T,
int N>
38 std::sort(v.begin(), v.end());
42 hash ^= hasher(i) + 0x9e3779b9 + (hash << 6) + (hash >> 2);
47 template <
typename T,
int N>
50 bool operator()(std::array<T, N> v1, std::array<T, N> v2)
const noexcept
53 std::sort(v1.begin(), v1.end());
54 std::sort(v2.begin(), v2.end());
67 hash ^= hasher(i) + 0x9e3779b9 + (hash << 6) + (hash >> 2);
76 template <
typename Scalar,
int Rows,
int Cols>
77 size_t operator()(
const Eigen::Matrix<Scalar, Rows, Cols> &matrix)
const
80 for (
size_t i = 0; i < matrix.size(); ++i)
82 Scalar elem = *(matrix.data() + i);
84 std::hash<Scalar>()(elem) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
bool operator()(std::array< T, N > v1, std::array< T, N > v2) const noexcept
size_t operator()(const Eigen::Matrix< Scalar, Rows, Cols > &matrix) const
size_t operator()(const std::pair< T1, T2 > &p) const noexcept
Hash function for an array where the order does not matter.
size_t operator()(std::array< T, N > v) const noexcept
size_t operator()(const std::vector< T > &v) const