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

uncertain_blockmodel: Fix sampling issues

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