Commit 0bc62ada authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Remove references to tr1::hash<> and boost::hash<> in favor of std::hash<>

parent 2092c3c6
......@@ -56,7 +56,7 @@ get_triangles(typename graph_traits<Graph>::vertex_descriptor v, const Graph &g)
typedef typename graph_traits<Graph>::vertex_descriptor vertex_t;
#ifdef HAVE_SPARSEHASH
typedef dense_hash_set<vertex_t> set_t;
typedef dense_hash_set<vertex_t, std::hash<vertex_t>> set_t;
#else
typedef unordered_set<vertex_t> set_t;
#endif
......
......@@ -465,8 +465,7 @@ struct gen_graph
set<deg_t, cmp_in<greater<size_t> > > targets;
// vertices with a given degree
unordered_map<deg_t, vector<size_t>,
boost::hash<deg_t> > vset;
unordered_map<deg_t, vector<size_t>> vset;
size_t num_e = 0;
for (size_t i = 0; i < vertices.size(); ++i)
......
......@@ -121,8 +121,7 @@ struct get_geometric
}
std::unordered_multimap<vector<int>,
typename graph_traits<Graph>::vertex_descriptor,
boost::hash<vector<int> > > boxes;
typename graph_traits<Graph>::vertex_descriptor> boxes;
for (int i = 0; i < N; ++i)
{
......
......@@ -527,9 +527,9 @@ protected:
rng_t& _rng;
#ifdef HAVE_SPARSEHASH
typedef google::dense_hash_map<size_t, size_t> nmapv_t;
typedef google::dense_hash_map<size_t, size_t, std::hash<size_t>> nmapv_t;
#else
typedef unordered_map<size_t, size_t> nmapv_t;
typedef unordered_map<size_t, size_t> nmapv_t;
#endif
typedef typename property_map_type::apply<nmapv_t,
typename property_map<Graph, vertex_index_t>::type>
......@@ -668,12 +668,11 @@ private:
#ifdef HAVE_SPARSEHASH
typedef google::dense_hash_map<deg_t,
vector<pair<size_t, bool>>,
boost::hash<deg_t>>
std::hash<deg_t>>
edges_by_end_deg_t;
#else
typedef std::unordered_map<deg_t,
vector<pair<size_t, bool>>,
boost::hash<deg_t>>
vector<pair<size_t, bool>>>
edges_by_end_deg_t;
#endif
......@@ -724,7 +723,7 @@ public:
if (_probs.empty())
{
std::unordered_set<deg_t, boost::hash<deg_t> > deg_set;
std::unordered_set<deg_t> deg_set;
for (size_t ei = 0; ei < base_t::_edges.size(); ++ei)
{
edge_t& e = base_t::_edges[ei];
......@@ -826,10 +825,9 @@ private:
#ifdef HAVE_SPARSEHASH
typedef google::dense_hash_map<pair<deg_t, deg_t>, double,
boost::hash<pair<deg_t, deg_t>>> prob_map_t;
std::hash<pair<deg_t, deg_t>>> prob_map_t;
#else
typedef std::unordered_map<pair<deg_t, deg_t>, double,
boost::hash<pair<deg_t, deg_t>>> prob_map_t;
typedef std::unordered_map<pair<deg_t, deg_t>, double> prob_map_t;
#endif
prob_map_t _probs;
......@@ -1185,7 +1183,8 @@ private:
BlockDeg _blockdeg;
#ifdef HAVE_SPARSEHASH
typedef google::dense_hash_map<deg_t, Sampler<deg_t, boost::mpl::false_>*> sampler_map_t;
typedef google::dense_hash_map<deg_t, Sampler<deg_t, boost::mpl::false_>*,
std::hash<deg_t>> sampler_map_t;
#else
typedef std::unordered_map<deg_t, Sampler<deg_t, boost::mpl::false_>*> sampler_map_t;
#endif
......@@ -1193,7 +1192,10 @@ private:
sampler_map_t _sampler;
#ifdef HAVE_SPARSEHASH
typedef google::dense_hash_map<deg_t, google::dense_hash_map<deg_t, double>> sprob_map_t;
typedef google::dense_hash_map<deg_t,
google::dense_hash_map<deg_t, double,
std::hash<deg_t>>,
std::hash<deg_t>> sprob_map_t;
#else
typedef std::unordered_map<deg_t, std::unordered_map<deg_t, double>> sprob_map_t;
#endif
......@@ -1202,15 +1204,17 @@ private:
#ifdef HAVE_SPARSEHASH
typedef google::dense_hash_map<pair<deg_t, deg_t>, double, boost::hash<pair<deg_t, deg_t>>> prob_map_t;
typedef google::dense_hash_map<pair<deg_t, deg_t>, double,
std::hash<pair<deg_t, deg_t>>> prob_map_t;
#else
typedef std::unordered_map<pair<deg_t, deg_t>, double, boost::hash<pair<deg_t, deg_t>>> prob_map_t;
typedef std::unordered_map<pair<deg_t, deg_t>, double> prob_map_t;
#endif
prob_map_t _probs;
#ifdef HAVE_SPARSEHASH
typedef google::dense_hash_map<deg_t, vector<size_t>> edge_map_t;
typedef google::dense_hash_map<deg_t, vector<size_t>,
std::hash<deg_t>> edge_map_t;
#else
typedef std::unordered_map<deg_t, vector<size_t>> edge_map_t;
#endif
......@@ -1253,8 +1257,7 @@ public:
_vertices[d].push_back(*v);
}
std::unordered_map<pair<deg_t, deg_t>, double, boost::hash<pair<deg_t, deg_t> > >
probs;
std::unordered_map<pair<deg_t, deg_t>, double> probs;
_corr_prob.get_probs(probs);
vector<double> dprobs;
......@@ -1347,7 +1350,8 @@ private:
rng_t& _rng;
#ifdef HAVE_SPARSEHASH
google::dense_hash_map<deg_t, vector<vertex_t>> _vertices;
google::dense_hash_map<deg_t, vector<vertex_t>,
std::hash<deg_t>> _vertices;
#else
std::unordered_map<deg_t, vector<vertex_t>> _vertices;
#endif
......
......@@ -252,7 +252,7 @@ struct do_perfect_vhash
{
typedef typename property_traits<VertexPropertyMap>::value_type val_t;
typedef typename property_traits<HashProp>::value_type hash_t;
typedef unordered_map<val_t, hash_t, boost::hash<val_t>> dict_t;
typedef unordered_map<val_t, hash_t> dict_t;
if (adict.empty())
adict = dict_t();
......@@ -291,7 +291,7 @@ struct do_perfect_ehash
{
typedef typename property_traits<EdgePropertyMap>::value_type val_t;
typedef typename property_traits<HashProp>::value_type hash_t;
typedef unordered_map<val_t, hash_t, boost::hash<val_t>> dict_t;
typedef unordered_map<val_t, hash_t> dict_t;
if (adict.empty())
adict = dict_t();
......
......@@ -96,9 +96,7 @@ struct do_propagate_pos
typedef typename pos_t::value_type val_t;
uniform_real_distribution<val_t> noise(-delta, delta);
unordered_map<c_t, pos_t, boost::hash<c_t> >
cmap(num_vertices(*cg));
unordered_map<c_t, pos_t> cmap(num_vertices(*cg));
for (auto v : vertices_range(*cg))
cmap[cvmap[v]] = cpos[v];
......
......@@ -51,9 +51,9 @@ struct label_parallel_edges
continue;
#ifdef HAVE_SPARSEHASH
google::dense_hash_map<vertex_t, edge_t> vset;
google::dense_hash_map<vertex_t, edge_t, std::hash<vertex_t>> vset;
vset.set_empty_key(graph_traits<Graph>::null_vertex());
google::dense_hash_map<size_t, bool> self_loops;
google::dense_hash_map<size_t, bool, std::hash<size_t>> self_loops;
self_loops.set_empty_key(numeric_limits<size_t>::max());
#else
unordered_map<vertex_t, edge_t> vset;
......
......@@ -53,11 +53,9 @@ struct get_similarity
typedef typename property_traits<LabelMap>::value_type label_t;
std::unordered_map<label_t, typename graph_traits<Graph1>::vertex_descriptor,
boost::hash<label_t>>
std::unordered_map<label_t, typename graph_traits<Graph1>::vertex_descriptor>
lmap1;
std::unordered_map<label_t, typename graph_traits<Graph2>::vertex_descriptor,
boost::hash<label_t>>
std::unordered_map<label_t, typename graph_traits<Graph2>::vertex_descriptor>
lmap2;
for (auto v : vertices_range(g1))
......@@ -75,9 +73,9 @@ struct get_similarity
continue;
auto v2 = li2->second;
std::unordered_set<label_t, boost::hash<label_t>> keys;
std::unordered_multiset<label_t, boost::hash<label_t>> adj1;
std::unordered_multiset<label_t, boost::hash<label_t>> adj2;
std::unordered_set<label_t> keys;
std::unordered_multiset<label_t> adj1;
std::unordered_multiset<label_t> adj2;
for (auto a1 : adjacent_vertices_range(v1, g1))
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment