summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2017-10-19 15:21:40 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2017-10-19 15:21:40 -0400
commit52893989132d031857eac9463f40d74bf8bec37a (patch)
treedc85ff10e2b582926041686cf9654fbfc0d48159
parent223f0e3a0d7f54cec89ae519f5b6f368a41d452f (diff)
downloadc++-52893989132d031857eac9463f40d74bf8bec37a.tar.gz
c++-52893989132d031857eac9463f40d74bf8bec37a.tar.bz2
c++-52893989132d031857eac9463f40d74bf8bec37a.zip
fixed problem where execution ends prematurely if diff is nan
-rw-r--r--src/wolff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wolff.c b/src/wolff.c
index fac13d4..191a5dd 100644
--- a/src/wolff.c
+++ b/src/wolff.c
@@ -146,7 +146,7 @@ int main(int argc, char *argv[]) {
uint64_t batch_flips = 0;
printf("\n");
- while ((diff > eps && n_steps < N) || n_runs < min_runs) {
+ while (((diff > eps || diff != diff) && n_steps < N) || n_runs < min_runs) {
printf("\033[F\033[JWOLFF: sweep %" PRIu64
", dH/H = %.4f, dM/M = %.4f, dC/C = %.4f, dX/X = %.4f, cps: %.1f\n",
n_runs, fabs(E->dx / E->x), M->dx / M->x, E->dc / E->c, M->dc / M->c, clust_per_sweep);