From 76e9388a35c7d556407f85e471b57ea4d3e432c6 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 8 Feb 2018 14:57:47 -0500 Subject: fixed zero magnetization counting problem --- src/wolff.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/wolff.c b/src/wolff.c index 2bd9c7d..60861b2 100644 --- a/src/wolff.c +++ b/src/wolff.c @@ -158,7 +158,7 @@ int main(int argc, char *argv[]) { } update_meas(E, s->E); - q_t max_M_i = 0; + int max_M_i = -1; double max_M = 0; for (q_t i = 0; i < q; i++) { @@ -168,10 +168,12 @@ int main(int argc, char *argv[]) { } } - for (q_t i = 0; i < q; i++) { - update_meas(sM[max_M_i][i], s->M[i]); + if (max_M_i != -1) { + for (q_t i = 0; i < q; i++) { + update_meas(sM[max_M_i][i], s->M[i]); + } + update_meas(sE[max_M_i], s->E); } - update_meas(sE[max_M_i], s->E); diff = fabs(sM[0][0]->dc / sM[0][0]->c); -- cgit v1.2.3-70-g09d2