Boost logo

Boost :

From: nbecker_at_[hidden]
Date: 2001-04-03 09:40:51

I just noticed a problem with the design of the random number

It is typical to need multiple generators within one program. A good
way to ensure independence is to share a single underlying uniform

It doesn't look like random.hpp is designed to allow this.private:

for example,

class normal_distribution {
  uniform_01<base_type, RealType> _rng;

So _rng will be a copy of the rng passed. It appears to me that the
copy will not share all the state of the uniform generator passed in.
For example, if mersenne_twister is used, at least the variable "i"
will be independently incremented by each instance of

Wouldn't it be better if _rng was a reference to allow for shared

Boost list run by bdawes at, gregod at, cpdaniel at, john at