Commit 28b189f7 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix bug in assortativity()

parent 44183262
......@@ -74,8 +74,9 @@ struct get_assortativity_coefficient
for (auto& ai : a)
{
if (b.find(ai.second) != b.end())
t2 += double(ai.second * b[ai.first]);
auto bi = b.find(ai.first);
if (bi != b.end())
t2 += ai.second * bi->second;
}
t2 /= n_edges*n_edges;
......
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