
22 Jul
2004
22 Jul
'04
10:04 a.m.
Hi, a seed(0) with a mersenne_twister (like mt11213b or mt19937) aborts on some assertion (tested on boost 1.31). boost/random/linear_congruential.hpp:61: boost::random::linear_congruential<IntType, a, c, m, val>::linear_congruential(IntType) [with IntType = uint32_t, IntType a = 69069, IntType c = 0, IntType m = 0, IntType val = 0]: Assertion `c || x0' failed. mersenne_twister::seed(x) calls linear_congruential<uint32_t, 69069, 0, 0, /* unknown */ 0>(x), which asserts(0 || x). So x must be non-zero. I didn't see it in the doc, but I think it would be a good thing to have it written down, or to have mersenne_twister::seed() modified to avoid the assertion. Regards, -- Benoît Sibaud