Commit 41e8c3fe authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Replace gt_hash_map by unordered_map for std::string and other generic keys

parent b8fe4467
......@@ -42,7 +42,7 @@ struct ec_hist
void operator()(Graph&g, const EVMap& ev, EMap& ec) const
{
typedef typename property_traits<EVMap>::value_type val_t;
gt_hash_map<val_t, size_t> ehist;
unordered_map<val_t, size_t> ehist;
for (auto e : edges_range(g))
{
auto iter = ehist.find(ev[e]);
......
......@@ -46,7 +46,7 @@ struct get_community_network_vertices
typedef typename boost::property_traits<CommunityMap>::value_type
s_type;
gt_hash_map<s_type, vertex_t, std::hash<s_type> > comms;
unordered_map<s_type, vertex_t> comms;
// create vertices
for (auto vi : vertices_range(g))
......@@ -107,9 +107,9 @@ struct get_community_network_edges
typedef typename boost::property_traits<CommunityMap>::value_type
s_type;
typedef gt_hash_map<s_type, vertex_t, std::hash<s_type> > comms_t;
typedef unordered_map<s_type, vertex_t> comms_t;
comms_t comms;
typedef gt_hash_map<cvertex_t, cedge_t> ecomms_t;
typedef unordered_map<cvertex_t, cedge_t> ecomms_t;
auto index_map = get(vertex_index_t(), cg);
unchecked_vector_property_map<ecomms_t, decltype(index_map)>
......@@ -234,7 +234,7 @@ struct get_vertex_community_property_sum
typedef typename boost::property_traits<CommunityMap>::value_type
s_type;
gt_hash_map<s_type, vertex_t> comms;
unordered_map<s_type, vertex_t> comms;
for (auto v : vertices_range(cg))
comms[cs_map[v]] = v;
......@@ -274,7 +274,7 @@ struct get_edge_community_property_sum
typedef typename boost::property_traits<CommunityMap>::value_type
s_type;
gt_hash_map<s_type, vertex_t> comms;
unordered_map<s_type, vertex_t> comms;
for (auto v : vertices_range(cg))
comms[cs_map[v]] = v;
......
......@@ -643,8 +643,8 @@ public:
private:
BlockDeg _blockdeg;
typedef gt_hash_map<deg_t,
vector<pair<size_t, bool>>>
typedef std::unordered_map<deg_t,
vector<pair<size_t, bool>>>
edges_by_end_deg_t;
edges_by_end_deg_t _edges_by_target;
......@@ -691,7 +691,7 @@ public:
if (_probs.empty())
{
gt_hash_set<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];
......@@ -790,7 +790,7 @@ private:
BlockDeg _blockdeg;
typedef gt_hash_map<pair<deg_t, deg_t>, double> prob_map_t;
typedef std::unordered_map<pair<deg_t, deg_t>, double> prob_map_t;
prob_map_t _probs;
};
......@@ -829,7 +829,7 @@ public:
if (!is_directed::apply<Graph>::type::value)
_out_pos.resize(base_t::_edges.size());
gt_hash_set<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];
......@@ -893,8 +893,8 @@ public:
}
else
{
gt_hash_map<deg_t, vector<double>> sprobs;
gt_hash_map<deg_t, vector<deg_t>> sitems;
std::unordered_map<deg_t, vector<double>> sprobs;
std::unordered_map<deg_t, vector<deg_t>> sitems;
for (auto iter = _probs.begin(); iter != _probs.end(); ++iter)
{
deg_t s = iter->first.first;
......@@ -1126,19 +1126,19 @@ private:
CorrProb _corr_prob;
BlockDeg _blockdeg;
typedef gt_hash_map<deg_t, Sampler<deg_t, boost::mpl::false_>*> sampler_map_t;
typedef std::unordered_map<deg_t, Sampler<deg_t, boost::mpl::false_>*> sampler_map_t;
sampler_map_t _sampler;
typedef gt_hash_map<deg_t, gt_hash_map<deg_t, double>> sprob_map_t;
typedef std::unordered_map<deg_t, std::unordered_map<deg_t, double>> sprob_map_t;
sprob_map_t _sprob;
typedef gt_hash_map<pair<deg_t, deg_t>, double> prob_map_t;
typedef std::unordered_map<pair<deg_t, deg_t>, double> prob_map_t;
prob_map_t _probs;
typedef gt_hash_map<deg_t, vector<size_t>> edge_map_t;
typedef std::unordered_map<deg_t, vector<size_t>> edge_map_t;
edge_map_t _in_edges;
edge_map_t _out_edges;
......@@ -1173,7 +1173,7 @@ public:
_vertices[d].push_back(*v);
}
gt_hash_map<pair<deg_t, deg_t>, double> probs;
std::unordered_map<pair<deg_t, deg_t>, double> probs;
_corr_prob.get_probs(probs);
vector<double> dprobs;
......@@ -1265,7 +1265,7 @@ private:
BlockDeg _blockdeg;
rng_t& _rng;
gt_hash_map<deg_t, vector<vertex_t>> _vertices;
std::unordered_map<deg_t, vector<vertex_t>> _vertices;
vector<pair<deg_t, deg_t> > _items;
Sampler<pair<deg_t, deg_t> >* _sampler;
......
......@@ -106,7 +106,7 @@ struct get_triangulation
template <class Graph, class Points, class PosMap>
void operator()(Graph& g, Points& points, PosMap pos) const
{
typedef gt_hash_map
typedef std::unordered_map
<typename Triang::Vertex,
typename graph_traits<Graph>::vertex_descriptor,
hash_point> vertex_map_t;
......
......@@ -162,7 +162,7 @@ struct do_infect_vertex_property
typedef typename property_traits<PropertyMap>::value_type val_t;
bool all = false;
gt_hash_set<val_t> vals;
std::unordered_set<val_t> vals;
if (oval == boost::python::object())
{
all = true;
......@@ -263,7 +263,7 @@ struct do_perfect_vhash
{
typedef typename property_traits<VertexPropertyMap>::value_type val_t;
typedef typename property_traits<HashProp>::value_type hash_t;
typedef gt_hash_map<val_t, hash_t> dict_t;
typedef unordered_map<val_t, hash_t> dict_t;
if (adict.empty())
adict = dict_t();
......@@ -302,7 +302,7 @@ struct do_perfect_ehash
{
typedef typename property_traits<EdgePropertyMap>::value_type val_t;
typedef typename property_traits<HashProp>::value_type hash_t;
typedef gt_hash_map<val_t, hash_t> dict_t;
typedef unordered_map<val_t, hash_t> dict_t;
if (adict.empty())
adict = dict_t();
......
......@@ -527,7 +527,7 @@ class HashedDescriptorMap
{
public:
typedef DescriptorHash<IndexMap> hashfc_t;
typedef gt_hash_map<typename IndexMap::key_type,Value,hashfc_t>
typedef unordered_map<typename IndexMap::key_type,Value,hashfc_t>
map_t;
typedef boost::associative_property_map<map_t> prop_map_t;
......
......@@ -300,5 +300,4 @@ public:
};
#endif // HASH_MAP_WRAP_HH
......@@ -52,9 +52,9 @@ struct get_similarity
typedef typename property_traits<LabelMap>::value_type label_t;
gt_hash_map<label_t, typename graph_traits<Graph1>::vertex_descriptor>
std::unordered_map<label_t, typename graph_traits<Graph1>::vertex_descriptor>
lmap1;
gt_hash_map<label_t, typename graph_traits<Graph2>::vertex_descriptor>
std::unordered_map<label_t, typename graph_traits<Graph2>::vertex_descriptor>
lmap2;
for (auto v : vertices_range(g1))
......@@ -72,7 +72,7 @@ struct get_similarity
continue;
auto v2 = li2->second;
gt_hash_set<label_t> keys;
std::unordered_set<label_t> keys;
std::unordered_multiset<label_t> adj1;
std::unordered_multiset<label_t> adj2;
......@@ -134,7 +134,7 @@ struct get_similarity_fast
auto v1 = lmap1[i];
auto v2 = lmap2[i];
gt_hash_set<label_t> keys;
std::unordered_set<label_t> keys;
std::unordered_multiset<label_t> adj1;
std::unordered_multiset<label_t> adj2;
......
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