From f2f7a072216dfafab89851e4ff3e0b2c3eb16663 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Wed, 17 Oct 2018 19:33:25 -0400 Subject: removed a lot of research code to simplify library and examples for publication --- lib/include/wolff.hpp | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'lib/include/wolff.hpp') 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 -void wolff(count_t N, state_t & s, std::function gen_R, wolff_measurement& 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& S, + std::function r_gen, + wolff_measurement& A, std::mt19937& rng) { - std::uniform_int_distribution dist(0, s.nv); + std::uniform_int_distribution 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(s, v0, step, r, m); + wolff_cluster_flip(S, i0, r, rng, A); - m.post_cluster(s, steps, N); + A.post_cluster(n, N, S); } - } +#endif + -- cgit v1.2.3-70-g09d2