Commit ac607229 authored by Tiago Peixoto's avatar Tiago Peixoto

multiflip_mcmc(): fix detailed balance

parent 2da36167
......@@ -119,14 +119,6 @@ python::object do_multiflip_mcmc_sweep_parallel(python::object omcmc_states,
return orets;
}
namespace graph_tool
{
std::ostream& operator<<(std::ostream& os, move_t move)
{
return os << static_cast<int>(move);
}
}
void export_blockmodel_multiflip_mcmc()
{
using namespace boost::python;
......
......@@ -64,7 +64,7 @@ auto mcmc_sweep(MCMCState state, RNG& rng)
auto beta = state.get_beta();
typedef std::remove_const_t<decltype(state._null_move)> move_t;
constexpr bool single_step =
constexpr bool single_step =
std::is_same_v<decltype(state.move_proposal(vlist.front(), rng)),
move_t>;
......@@ -87,7 +87,7 @@ auto mcmc_sweep(MCMCState state, RNG& rng)
return state.get_N();
};
for (size_t vi = 0; vi < get_N(); vi += nsteps)
for (size_t vi = 0; vi < get_N(); ++vi)
{
auto v = (state.is_sequential()) ?
vlist[vi] : uniform_sample(vlist, rng);
......
......@@ -852,6 +852,9 @@ class NestedBlockState(object):
"""
psingle = kwargs.get("psingle", self.g.num_vertices())
kwargs["psingle"] = psingle
c = kwargs.pop("c", 1)
if not isinstance(c, collections.Iterable):
c = [c * 2 ** l for l in range(0, len(self.levels))]
......
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