Commit d667e0e6 authored by Etienne Renault's avatar Etienne Renault

twacube: fix bug in swarming for large formulae

This bug is similar to the one described in  commit
d956fdc3.

* spot/twacube/twacube.hh: Here.
parent 6f3e5559
......@@ -112,8 +112,10 @@ namespace spot
// precomputed primes and seed access one of this primes. Note
// that the chosen prime must be greater than n.
SPOT_ASSERT(primes[seed] > (st_.succ_tail-st_.succ+1));
return (((idx_-st_.succ+1)*primes[seed]) % (st_.succ_tail-st_.succ+1))
+ st_.succ;
unsigned long long c = (idx_-st_.succ) + 1;
unsigned long long p = primes[seed];
unsigned long long s = (st_.succ_tail-st_.succ+1);
return (unsigned) (((c*p) % s)+st_.succ);
}
private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment