18 #include <boost/functional/hash.hpp>
19 #include <boost/graph/graph_traits.hpp>
32 template <
typename Graph,
class Enable =
void>
struct edge_hash {
33 typedef typename boost::graph_traits<Graph>::edge_descriptor Edge;
43 boost::hash_combine(hash, std::min(e.m_source, e.m_target));
44 boost::hash_combine(hash, std::max(e.m_source, e.m_target));
55 template <
typename Graph>
57 typename std::enable_if<std::is_same<
58 typename boost::graph_traits<Graph>::directed_category,
59 boost::directed_tag>::value>::type> {
60 typedef typename boost::graph_traits<Graph>::edge_descriptor Edge;
70 boost::hash_combine(hash, e.m_source);
71 boost::hash_combine(hash, e.m_target);
93 template <
typename Range>
95 return boost::hash_range(std::begin(range), std::end(range));
101 #endif // PAAL_HASH_HPP
Functor that can be used as a std::unordered_map/set hash param, when key is a range. copied from: http://stackoverflow.com/questions/10405030/c-unordered-map-fail-when-used-with-a-vector-as-key.
std::size_t operator()(Range &&range) const
hash for edge_descriptor in bgl, undirected version
std::size_t operator()(const Edge &e) const
operator()
std::size_t operator()(const Edge &e) const
operator()