From 52893989132d031857eac9463f40d74bf8bec37a Mon Sep 17 00:00:00 2001
From: Jaron Kent-Dobias <jaron@kent-dobias.com>
Date: Thu, 19 Oct 2017 15:21:40 -0400
Subject: fixed problem where execution ends prematurely if diff is nan

---
 src/wolff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src')

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);
-- 
cgit v1.2.3-70-g09d2