
7 Nov
2008
7 Nov
'08
1:20 a.m.
On Fri, Nov 7, 2008 at 12:44 AM, Dave Steenburgh <dave.steenburgh@gmail.com> wrote:
mt19937 rng; normal_distribution<> gauss; variate_generator<mt19937&, normal_distribution<> > var(rng, gauss);
gauss is passed by value, and so var has a copy of it. This means that when you generate values with var, the state of gauss does not change.
Wow, thanks for helping me out there so fast. I completely missed this, and was especially confused because storing rng did work - which, I only now realise, is because that is passed by reference (something I did to share the generator among several variate_generators I suppose). Thanks. I'll sleep more sound now :)