twacube: fix bug in swarming for large formulae
This bug is similar to the one described in commit d956fdc385b4dd9a5c5b3a63a0de80a09eb8e40d. * spot/twacube/twacube.hh: Here.
This commit is contained in:
parent
276892229c
commit
87afcd2f87
1 changed files with 4 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue