
11 Feb
2004
11 Feb
'04
5:54 p.m.
For the new random number generators, if I want to share a single underlying uniform random generator, I need to do like so: typedef boost::mt19937 rng_t; rng_t rng; boost::variate_generator<rng_t&, boost::normal_distribution<> > tn (rng, boost::normal_distribution<> (0, sqrt (var))); boost::variate_generator<rng_t&, boost::pnseq_generator<1> > pn (rng, boost::pnseq_generator<1>()); That is, I need to say "rng_t&" for the 1st template param rather than "rng_t". Is this correct? The old rng lib passed the engine by ref in the constructor, but the new one doesn't. Correct?