-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MixMax RNG with variate_generator returns constant values when initialised with seed = 0 #104
Comments
@kotika Does a check need to be added to ensure the user gives a non-zero seed? We could throw |
This seems to be the case only when the 4-argument version is called with all zeros. If the line random/include/boost/random/mixmax.hpp Lines 183 to 184 in 0190232
was updated to e.g. Then the issue appears to go away https://arxiv.org/pdf/1403.5355 includes the line
(emphasis mine), which seems to imply any restriction should just be on the full four-argument form. The uint64_t overload could be made to never have an invalid value if at least one of the two other arguments were nonzero, I believe. My question is if the statement " Several other implementations do seem to trap the seed being 0: |
The seeding method has been significantly improved since the time ROOT and FORTRAN versions were produced. |
When the
mixmax
RNG is initialised with a seed of 0 and used withvariate_generator
, repeated calls always produce the same value:Reproducible example (here on godbolt):
Returns:
The text was updated successfully, but these errors were encountered: