Commit 3797adfb authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

blockmodel: modify verbose information

parent 822db1f2
......@@ -44,7 +44,7 @@ using namespace std;
((allow_vacate,, bool, 0)) \
((sequential,, bool, 0)) \
((deterministic,, bool, 0)) \
((verbose,, bool, 0)) \
((verbose,, int, 0)) \
((niter,, size_t, 0))
......
......@@ -41,7 +41,7 @@ using namespace std;
((S_max, , double, 0)) \
((f, , double, 0)) \
((S, , double, 0)) \
((verbose,, bool, 0))
((verbose,, int, 0))
template <class State>
......
......@@ -44,7 +44,7 @@ using namespace std;
((psplit,, double, 0)) \
((gibbs_sweeps,, size_t, 0)) \
((entropy_args,, entropy_args_t, 0)) \
((verbose,, bool, 0)) \
((verbose,, int, 0)) \
((niter,, size_t, 0))
enum class move_t { single_node = 0, split, merge, null };
......@@ -523,6 +523,9 @@ struct MCMC
void perform_move(size_t r, move_t move)
{
if (_verbose && move == move_t::merge)
cout << "merge: " << _groups[r].size() << " " << _groups[_s].size() << " " << endl;
for (auto v : _vs)
move_vertex(v, _bnext[v]);
......@@ -535,6 +538,8 @@ struct MCMC
add_element(_rlist, _rpos, _s);
break;
case move_t::split:
if (_verbose)
cout << "split: " << _groups[_s].size() << " " << _groups[_t].size() << " " << endl;
remove_element(_rlist, _rpos, r);
add_element(_rlist, _rpos, _s);
add_element(_rlist, _rpos, _t);
......
......@@ -95,7 +95,7 @@ auto mcmc_sweep(MCMCState state, RNG& rng)
if (state.skip_node(v))
continue;
auto r = (state._verbose) ? state.node_state(v)
auto r = (state._verbose > 1) ? state.node_state(v)
: decltype(state.node_state(v))();
move_t s;
......@@ -125,7 +125,7 @@ auto mcmc_sweep(MCMCState state, RNG& rng)
state.step(v, s);
if (state._verbose)
if (state._verbose > 1)
cout << v << ": " << r << " -> " << s << " " << accept << " " << dS << " " << mP << " " << -dS * beta + mP << " " << S << endl;
}
......
......@@ -44,7 +44,7 @@ using namespace std;
((allow_vacate,, bool, 0)) \
((sequential,, bool, 0)) \
((deterministic,, bool, 0)) \
((verbose,, bool, 0)) \
((verbose,, int, 0)) \
((niter,, size_t, 0))
......
......@@ -34,12 +34,12 @@ using namespace std;
typedef std::vector<size_t> vlist_t;
#define MCMC_EPIDEMICS_STATE_params(State) \
#define MCMC_EPIDEMICS_STATE_params(State) \
((__class__,&, mpl::vector<python::object>, 1)) \
((state, &, State&, 0)) \
((beta,, double, 0)) \
((hstep,, double, 0)) \
((verbose,, bool, 0)) \
((verbose,, int, 0) ) \
((niter,, size_t, 0))
......
......@@ -66,7 +66,7 @@ typedef std::vector<size_t> vlist_t;
((xlog,, bool, 0)) \
((xdefault,, double, 0)) \
((entropy_args,, uentropy_args_t, 0)) \
((verbose,, bool, 0)) \
((verbose,, int, 0)) \
((niter,, size_t, 0))
......
......@@ -39,7 +39,7 @@ typedef std::vector<size_t> vlist_t;
((beta,, double, 0)) \
((n,, size_t, 0)) \
((hstep,, double, 0)) \
((verbose,, bool, 0)) \
((verbose,, int, 0)) \
((niter,, size_t, 0))
......
......@@ -40,7 +40,7 @@ typedef std::vector<size_t> vlist_t;
((beta,, double, 0)) \
((entropy_args,, uentropy_args_t, 0)) \
((edges_only,, bool, 0)) \
((verbose,, bool, 0)) \
((verbose,, int, 0)) \
((niter,, size_t, 0))
......
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