From: Mark Wooding Date: Sun, 28 May 2017 18:03:08 +0000 (+0100) Subject: rho.cc: Fix the cycle-finding table initialization. X-Git-Url: https://git.distorted.org.uk/~mdw/rhodes/commitdiff_plain/a978ad10a5f726a71153218409be54f1248da2cf?hp=00d6f25ed61928f090404b32db70ac9a839c3965 rho.cc: Fix the cycle-finding table initialization. My initial cut was hopeless, but Teske's suggestion doesn't work either for trivial logs. This approach does. --- diff --git a/rho.cc b/rho.cc index 651211a..7033258 100644 --- a/rho.cc +++ b/rho.cc @@ -228,7 +228,8 @@ again: unsigned long long k = 0; if (!dpbits) - for (i = 0; i < NHIST; i++) h[i].k = 0; + for (i = 0; i < NHIST; i++) + { h[i].k = 0; h[i].y = a; h[i].u = 1; h[i].v = 0; } for (;;) { if (k >= niter) goto again;