diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-10-17 19:33:25 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-10-17 19:33:25 -0400 |
commit | f2f7a072216dfafab89851e4ff3e0b2c3eb16663 (patch) | |
tree | f9c7e1e4e91ce8b0ec9cef9f2423029fe7b7f049 /lib/include/wolff.hpp | |
parent | 1343a3fe6bd17a2487f12a0d61be8dc83cd722a0 (diff) | |
download | c++-f2f7a072216dfafab89851e4ff3e0b2c3eb16663.tar.gz c++-f2f7a072216dfafab89851e4ff3e0b2c3eb16663.tar.bz2 c++-f2f7a072216dfafab89851e4ff3e0b2c3eb16663.zip |
removed a lot of research code to simplify library and examples for publication
Diffstat (limited to 'lib/include/wolff.hpp')
-rw-r--r-- | lib/include/wolff.hpp | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/lib/include/wolff.hpp b/lib/include/wolff.hpp index b730c8d..b78cd4b 100644 --- a/lib/include/wolff.hpp +++ b/lib/include/wolff.hpp @@ -1,30 +1,27 @@ +#ifndef WOLFF_H +#define WOLFF_H + #include "wolff/cluster.hpp" -#include "wolff/state.hpp" template <class R_t, class X_t> -void wolff(count_t N, state_t <R_t, X_t>& s, std::function <R_t(std::mt19937&, X_t)> gen_R, wolff_measurement<R_t, X_t>& m, std::mt19937& r) { - -#ifdef FINITE_STATES -#ifdef NOFIELD - initialize_probs(s.J, s.T); -#else - initialize_probs(s.J, s.H, s.T); -#endif -#endif +void wolff(N_t N, wolff_system<R_t, X_t>& S, + std::function <R_t(std::mt19937&, X_t)> r_gen, + wolff_measurement<R_t, X_t>& A, std::mt19937& rng) { - std::uniform_int_distribution<v_t> dist(0, s.nv); + std::uniform_int_distribution<v_t> dist(0, S.nv - 1); - for (count_t steps = 0; steps < N; steps++) { - v_t v0 = dist(r); - R_t step = gen_R(r, s.spins[v0]); + for (N_t n = 0; n < N; n++) { + v_t i0 = dist(rng); + R_t r = r_gen(rng, S.s[i0]); - m.pre_cluster(s, steps, N, v0, step); + A.pre_cluster(n, N, S, i0, r); - flip_cluster<R_t, X_t>(s, v0, step, r, m); + wolff_cluster_flip<R_t, X_t>(S, i0, r, rng, A); - m.post_cluster(s, steps, N); + A.post_cluster(n, N, S); } - } +#endif + |