5#ifndef DUNE_COMMON_HASH_HH
6#define DUNE_COMMON_HASH_HH
100#define DUNE_DEFINE_HASH(template_args,type)
109#define DUNE_HASH_TEMPLATE_ARGS(...)
117#define DUNE_HASH_TYPE(...)
137#define DUNE_DEFINE_STD_HASH(template_args,type) \
140 template<template_args> \
144 typedef type argument_type; \
145 typedef std::size_t result_type; \
147 std::size_t operator()(const type& arg) const \
149 return hash_value(arg); \
153 template<template_args> \
154 struct hash<const type> \
157 typedef type argument_type; \
158 typedef std::size_t result_type; \
160 std::size_t operator()(const type& arg) const \
162 return hash_value(arg); \
178#define DUNE_HASH_TEMPLATE_ARGS(...) (__VA_ARGS__)
182#define DUNE_HASH_TYPE(...) (__VA_ARGS__)
186#define DUNE_HASH_EXPAND_VA_ARGS(...) __VA_ARGS__
189#define DUNE_DEFINE_HASH(template_args,type) \
190 DUNE_DEFINE_STD_HASH(DUNE_HASH_EXPAND_VA_ARGS template_args, DUNE_HASH_EXPAND_VA_ARGS type) \
225 template<
int sizeof_
size_t>
226 struct hash_combiner;
231 struct hash_combiner<8>
234 template<
typename typeof_
size_t,
typename T>
237 static_assert(
sizeof(
typeof_size_t)==8,
"hash_combiner::operator() instantiated with nonmatching type and size");
268 struct hash_combiner<4>
271 template<
typename typeof_
size_t,
typename T>
274 static_assert(
sizeof(
typeof_size_t)==4,
"hash_combiner::operator() instantiated with nonmatching type and size");
289 a = (
a >> 17) | (
a << (32 - 17));
292 h = (
h >> 19) | (
h << (32 - 19));
321 template<
typename It>
324 std::size_t
seed = 0;
340 template<
typename It>
Traits for type conversions and type information.
ArrayList()
Constructs an Array list with one chunk.
Definition arraylist.hh:457
Dune namespace.
Definition alignedallocator.hh:13
std::size_t hash_range(It first, It last)
Hashes all elements in the range [first,last) and returns the combined hash.
Definition hash.hh:322
void hash_combine(std::size_t &seed, const T &arg)
Calculates the hash value of arg and combines it in-place with seed.
Definition hash.hh:307
A dynamically growing random access list.
Definition arraylist.hh:62
Functor for hashing objects of type T.
Definition hash.hh:40
std::size_t operator()(const T &t) const
Calculates the hash of t.
Definition hash.hh:43