
Hi Steven, Thanks for you reply! I call it 1000 time, and all output is 0. On Tue, Mar 31, 2009 at 9:52 AM, Steven Watanabe <watanabesj@gmail.com>wrote:
AMDG
Barco You wrote:
Hi Mathias,
I did as you instructed.
double p = 0.5;
boost::mt19937 rng; boost::bernoulli_distribution<
d(p);
boost::variate_generator< boost::mt19937&, boost::bernoulli_distribution<> > g(rng, d);
double x = g();
But I got always 0 for x, why?
Did you try calling g() multiple times? The default constructor of boost::mt19937 puts it in a fixed state, so the sequence of numbers which it generates will always be the same.
In Christ, Steven Watanabe
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- ------------------------------- Enjoy life! Barco You