Boost logo

Boost Users :

From: Benoît SIBAUD (benoit.sibaud_at_[hidden])
Date: 2004-07-22 11:04:09


a seed(0) with a mersenne_twister (like mt11213b or mt19937) aborts on
some assertion (tested on boost 1.31).

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.


Benoît Sibaud

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at