Boost logo

Boost Users :

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


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

Same problem with minstd_rand, minstd_rand0, lagged_fibonacci (calls
minstd_rand0.seed(x))and ecuyer1988 (calls linear_congruential.seed(x)).

Solution used by glibc (glibc-2.3.2.ds1/glibc-2.3.2/stdlib/random_r.c) :

   /* We must make sure the seed is not 0. Take arbitrarily 1 in this
case. */
   if (seed == 0)
     seed = 1;

PS: seed(0) is ok for rand48, kreutzer1986 and hellekalek1995.

-- 
Benoît Sibaud

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net