From 4239e2bfc6701f0b5170132d01af381129618b34 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Wed, 10 Oct 2018 00:08:11 -0400 Subject: added new compile flag NOFIELD, which when defined compiles a version of wolff for use with zero field --- lib/state.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/state.h') diff --git a/lib/state.h b/lib/state.h index 3bbed39..cad453c 100644 --- a/lib/state.h +++ b/lib/state.h @@ -29,14 +29,22 @@ class state_t { std::vector ImF; std::function J; +#ifndef NOFIELD std::function H; state_t(D_t D, L_t L, double T, std::function J, std::function H) : D(D), L(L), g(D, L), T(T), R(), J(J), H(H) { +#else + state_t(D_t D, L_t L, double T, std::function J) : D(D), L(L), g(D, L), T(T), R(), J(J) { +#endif nv = g.nv; ne = g.ne; - g.add_ext(); spins.resize(nv); +#ifndef NOFIELD + g.add_ext(); E = - (double)ne * J(spins[0], spins[0]) - (double)nv * H(spins[0]); +#else + E = - (double)ne * J(spins[0], spins[0]); +#endif M = spins[0] * nv; last_cluster_size = 0; ReF.resize(D); -- cgit v1.2.3-70-g09d2