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

bethe_entropy(): fix overflow problem

parent da0ea999
......@@ -205,7 +205,7 @@ boost::python::tuple bethe_entropy(GraphInterface& gi, boost::any op,
for (auto v : vertices_range(g))
{
double sum = std::accumulate(pv[v].begin(), pv[v].end(), 0);
double sum = std::accumulate(pv[v].begin(), pv[v].end(), 0.);
for (double pi : pv[v])
{
if (pi == 0)
......
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