Commit e089bebb authored by Tiago Peixoto's avatar Tiago Peixoto

uncertain_blockmodel: Fix sampling issues

parent 710f08bc
......@@ -93,7 +93,10 @@ struct Measured
}
size_t N = num_vertices(_g);
_NP = graph_tool::is_directed(_g) ? N * N : (N * (N + 1)) / 2;
if (_self_loops)
_NP = graph_tool::is_directed(_g) ? N * N : (N * (N + 1)) / 2;
else
_NP = graph_tool::is_directed(_g) ? N * (N - 1) : (N * (N - 1)) / 2;
_N += (_NP - gE) * _n_default;
_X += (_NP - gE) * _x_default;
......
......@@ -77,7 +77,7 @@ struct MCMC
{
size_t u = _slist[ei];
size_t v = _tlist[ei];
if (u > num_vertices(_state._g))
if (u >= num_vertices(_state._g))
std::tie(u, v) = _e;
return {u, v};
}
......
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