summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/vector.h6
-rw-r--r--lib/wolff.h11
-rw-r--r--src/wolff_heisenberg.cpp2
-rw-r--r--src/wolff_planar.cpp2
4 files changed, 11 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);
}
diff --git a/src/wolff_heisenberg.cpp b/src/wolff_heisenberg.cpp
index 5403b49..ad3f3c6 100644
--- a/src/wolff_heisenberg.cpp
+++ b/src/wolff_heisenberg.cpp
@@ -138,6 +138,8 @@ int main(int argc, char *argv[]) {
free(H);
+ fftw_cleanup();
+
return 0;
}
diff --git a/src/wolff_planar.cpp b/src/wolff_planar.cpp
index 37eb6f8..bfb382f 100644
--- a/src/wolff_planar.cpp
+++ b/src/wolff_planar.cpp
@@ -141,6 +141,8 @@ int main(int argc, char *argv[]) {
free(H);
+ fftw_cleanup();
+
return 0;
}