Commit 1a33662e authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix issue with mcmc_gibbs() for weighted block graphs

parent f0bcd76e
Pipeline #133 failed with stage
......@@ -95,6 +95,9 @@ auto gibbs_sweep(GibbsState state, RNG& rng_)
v = vertex(vlist[v_rand(rng)], g);
}
if (state.skip(v))
continue;
vector<size_t>& moves = state.get_moves(v);
auto& weights = state.get_weights(v);
......
......@@ -135,6 +135,11 @@ struct Gibbs
return _state._b[v];
}
bool skip(size_t v)
{
return _state._vweight[v] == 0;
}
double virtual_move_dS(size_t v, size_t nr)
{
if (nr >= _B)
......@@ -182,6 +187,8 @@ struct Gibbs
weights.push_back(1);
}
assert(_state._wr[r] > 0);
_state.move_vertex(v, nr);
if (_state._wr[r] == 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