From bcae0db3ac84f3b1f7b0d93b2aa3b7af46ae7420 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 8 Feb 2018 15:03:18 -0500 Subject: really fixed it --- src/wolff.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/wolff.c') diff --git a/src/wolff.c b/src/wolff.c index 60861b2..6dc5c48 100644 --- a/src/wolff.c +++ b/src/wolff.c @@ -158,17 +158,21 @@ int main(int argc, char *argv[]) { } update_meas(E, s->E); - int max_M_i = -1; - double max_M = 0; + q_t max_M_i = 0; + v_t max_M = 0; + q_t n_at_max = 0; for (q_t i = 0; i < q; i++) { if (s->M[i] > max_M) { max_M = s->M[i]; max_M_i = i; + n_at_max = 1; + } else if (s->M[i] == max_M) { + n_at_max++; } } - if (max_M_i != -1) { + if (n_at_max == 1) { for (q_t i = 0; i < q; i++) { update_meas(sM[max_M_i][i], s->M[i]); } -- cgit v1.2.3-70-g09d2