Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-12-08 09:26:14


Rui Carvalho wrote:

> Vladimir Prus wrote:
>> Sure, because the random number generator is initialized with the same
> seed
>> on each invocation. You can seed it with current time or something like
>> that.
>
> Thanks for this. Is there anything on the docs/examples on how to
> initialize the random number generator?

http://boost.org/libs/random/random-generators.html#mersenne_twister

mentions this method:

  void seed(DataType value);

I think passing the result of time:

  #include <time.h>
  time_t time(time_t *t);

should work.

> I mean, boost/random/mersenne_twister.hpp seems to be an adaptation of the
> original Mersenne Twister by Matsumoto and Nishimura -is it the same as
> the original?

I don't know, sorry.

- Volodya


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