diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-10-10 00:08:11 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-10-10 00:08:11 -0400 |
commit | 4239e2bfc6701f0b5170132d01af381129618b34 (patch) | |
tree | f3429fc52a950f5fbd756d6fa0e5863e52b35393 /lib/state.h | |
parent | b01aedbf7d9cb6bdcdd291e6d4a66f3ef8fa7eb4 (diff) | |
download | c++-4239e2bfc6701f0b5170132d01af381129618b34.tar.gz c++-4239e2bfc6701f0b5170132d01af381129618b34.tar.bz2 c++-4239e2bfc6701f0b5170132d01af381129618b34.zip |
added new compile flag NOFIELD, which when defined compiles a version of wolff for use with zero field
Diffstat (limited to 'lib/state.h')
-rw-r--r-- | lib/state.h | 10 |
1 files changed, 9 insertions, 1 deletions
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<typename X_t::F_t> ImF; std::function <double(const X_t&, const X_t&)> J; +#ifndef NOFIELD std::function <double(const X_t&)> H; state_t(D_t D, L_t L, double T, std::function <double(const X_t&, const X_t&)> J, std::function <double(const X_t&)> 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 <double(const X_t&, const X_t&)> 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); |