Hi, Am 15. März 2012 13:54 schrieb Havona Studios: > The minstd, ran0, ran1, ran2 algorithms are show-stoppingly buggy when > unsigned long is used to seed. Workaround is to use unsigned int. > > minstd and ran0 are not producing uniform floats/doubles (compare > result with default) and go into 100% CPU loop on uniform_int, while > ran1 and ran2 will simply segfault on either function call. > > default and all others work as expected/documented.
I can confirm the problem, but only on a 64 bit system. Looking at the code where ran1 and ran2 crash seems to indicate that the functions assume implicitly that the "state" variable is a 32 bit number. Therefore, the fix would be to ensure that this is really the case in the *_set functions for these generators. The documentation [1] already says that some generators will reduce the seed to 32 bits. It seems that this was accidentally not done for the buggy generators. Best regards, Frank [1] http://www.gnu.org/software/gsl/manual/html_node/Random-number-generator-initialization.html
