diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-07-18 16:10:34 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-07-18 16:10:34 -0400 |
commit | 8a9793881d3dfa13440c516691144fd6cefa29db (patch) | |
tree | 06c37d39b889a4dbc0a2fdbf21ae8f2d462b3208 /lib | |
parent | b6b6235e9563b003e1932fd757b947e5a2eb9c9a (diff) | |
download | c++-8a9793881d3dfa13440c516691144fd6cefa29db.tar.gz c++-8a9793881d3dfa13440c516691144fd6cefa29db.tar.bz2 c++-8a9793881d3dfa13440c516691144fd6cefa29db.zip |
some reorganization
Diffstat (limited to 'lib')
-rw-r--r-- | lib/vector.h | 6 | ||||
-rw-r--r-- | lib/wolff.h | 11 |
2 files changed, 7 insertions, 10 deletions
diff --git a/lib/vector.h b/lib/vector.h index 88934c1..6c72fd1 100644 --- a/lib/vector.h +++ b/lib/vector.h @@ -88,3 +88,9 @@ double correlation_component(vector_t <q, T> v) { return (double)v.x[0]; } +template <q_t q, class T> +double H_vector(vector_t <q, T> v1, T *H) { + vector_t <q, T> H_vec; + H_vec.x = H; + return (double)(dot <q, T> (v1, H_vec)); +} diff --git a/lib/wolff.h b/lib/wolff.h index 2d7e8b2..eb357c7 100644 --- a/lib/wolff.h +++ b/lib/wolff.h @@ -2,13 +2,6 @@ #include "cluster.h" #include "state.h" -template <q_t q, class T> -double H_vector(vector_t <q, T> v1, T *H) { - vector_t <q, T> H_vec; - H_vec.x = H; - return (double)(dot <q, T> (v1, H_vec)); -} - template <class R_t, class X_t> void wolff(count_t N, D_t D, L_t L, double T, std::function <double(X_t, X_t)> J, std::function <double(X_t)> H, std::function <R_t(gsl_rng *, const state_t <R_t, X_t> *)> gen_R, unsigned int n_measurements, std::function <void(const state_t <R_t, X_t> *)> *measurements, bool silent) { @@ -30,15 +23,13 @@ void wolff(count_t N, D_t D, L_t L, double T, std::function <double(X_t, X_t)> J for (unsigned int i = 0; i < n_measurements; i++) { measurements[i](&s); } - } + if (!silent) { printf("\033[F\033[J"); } printf("WOLFF: sweep %" PRIu64 " / %" PRIu64 ": E = %.2f, S = %" PRIv "\n", N, N, s.E, s.last_cluster_size); - fftw_cleanup(); - gsl_rng_free(r); } |