diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-10-19 01:26:14 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-10-19 01:26:14 -0400 |
commit | 643baba78eb15a685d959aae718ee3eeade2f806 (patch) | |
tree | 35c35e5e383f7ae1937574f3c764a0f60a448e6e /lib/include/wolff.hpp | |
parent | f2f7a072216dfafab89851e4ff3e0b2c3eb16663 (diff) | |
download | c++-643baba78eb15a685d959aae718ee3eeade2f806.tar.gz c++-643baba78eb15a685d959aae718ee3eeade2f806.tar.bz2 c++-643baba78eb15a685d959aae718ee3eeade2f806.zip |
big library overhual, fixed all examples, added documentation with sphinx
Diffstat (limited to 'lib/include/wolff.hpp')
-rw-r--r-- | lib/include/wolff.hpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/include/wolff.hpp b/lib/include/wolff.hpp index b78cd4b..7e909c8 100644 --- a/lib/include/wolff.hpp +++ b/lib/include/wolff.hpp @@ -3,25 +3,30 @@ #define WOLFF_H #include "wolff/cluster.hpp" +#include "wolff/measurement.hpp" + +namespace wolff{ template <class R_t, class X_t> -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) { +void system<R_t, X_t>::run_wolff(N_t N, + std::function <R_t(std::mt19937&, const system<R_t, X_t>&, v_t)> r_gen, + measurement<R_t, X_t>& A, std::mt19937& rng) { - std::uniform_int_distribution<v_t> dist(0, S.nv - 1); + std::uniform_int_distribution<v_t> dist(0, nv - 1); for (N_t n = 0; n < N; n++) { v_t i0 = dist(rng); - R_t r = r_gen(rng, S.s[i0]); + R_t r = r_gen(rng, *this, i0); - A.pre_cluster(n, N, S, i0, r); + A.pre_cluster(n, N, *this, i0, r); - wolff_cluster_flip<R_t, X_t>(S, i0, r, rng, A); + this->flip_cluster(i0, r, rng, A); - A.post_cluster(n, N, S); + A.post_cluster(n, N, *this); } } +} + #endif |