Commit acac6789 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

src/graph/graph_community.cc: label spins continuously starting from zero


git-svn-id: https://svn.forked.de/graph-tool/trunk@67 d4600afd-f417-0410-95de-beed9576f240
parent 1ffb38cb
...@@ -369,6 +369,16 @@ struct get_communities ...@@ -369,6 +369,16 @@ struct get_communities
if (verbose.first) if (verbose.first)
cout << endl; cout << endl;
// rename spins, starting from zero
unordered_map<size_t,size_t> spins;
for (tie(v,v_end) = vertices(g); v != v_end; ++v)
{
if (spins.find(s[*v]) == spins.end())
spins[s[*v]] = spins.size() - 1;
s[*v] = spins[s[*v]];
}
} }
}; };
......
Supports Markdown
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