diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-02-08 15:03:18 -0500 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-02-08 15:03:18 -0500 |
commit | bcae0db3ac84f3b1f7b0d93b2aa3b7af46ae7420 (patch) | |
tree | d29e62be5836a5c988b5be677bd6fff989460e63 /src | |
parent | 76e9388a35c7d556407f85e471b57ea4d3e432c6 (diff) | |
download | c++-bcae0db3ac84f3b1f7b0d93b2aa3b7af46ae7420.tar.gz c++-bcae0db3ac84f3b1f7b0d93b2aa3b7af46ae7420.tar.bz2 c++-bcae0db3ac84f3b1f7b0d93b2aa3b7af46ae7420.zip |
really fixed it
Diffstat (limited to 'src')
-rw-r--r-- | src/wolff.c | 10 |
1 files changed, 7 insertions, 3 deletions
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]); } |