Commit b22e65f8 authored by Tiago Peixoto's avatar Tiago Peixoto

Fix issue with multiflip_mcmc()

parent 3dbc7b5a
Pipeline #475 failed with stage
in 479 minutes and 12 seconds
......@@ -1763,11 +1763,12 @@ public:
if (_empty_blocks.empty())
add_block();
s = uniform_sample(_empty_blocks, rng);
_bclabel[s] = _bclabel[_b[v]];
auto r = _b[v];
_bclabel[s] = _bclabel[r];
if (_coupled_state != nullptr)
{
auto& hb = _coupled_state->get_b();
hb[s] = hb[_b[v]];
hb[s] = hb[r];
}
return s;
}
......
......@@ -154,7 +154,6 @@ struct MCMC
_groups.resize(t + 1);
_rpos.resize(t + 1);
}
assert(_state._wr[t] == 0);
return t;
}
......@@ -199,11 +198,8 @@ struct MCMC
if (rt[1] == null_group)
{
if (forward)
rt[1] = sample_new_group(v, rng);
else
rt[1] = (_state.virtual_remove_size(v) == 0) ?
r : sample_new_group(v, rng);
rt[1] = (_state.virtual_remove_size(v) == 0) ?
r : sample_new_group(v, rng);
dS += _state.virtual_move(v, _state._b[v], rt[1],
_entropy_args);
if (forward)
......
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