
31 Mar
2009
31 Mar
'09
3:11 a.m.
AMDG Barco You wrote:
I call it 1000 time, and all output is 0.
Works for me... #include <boost/random.hpp> #include <iostream> int main() { double p = 0.5; boost::mt19937 rng; boost::bernoulli_distribution<> d(p); boost::variate_generator< boost::mt19937&, boost::bernoulli_distribution<> > g(rng, d); for(int i = 0; i < 10; ++i) { std::cout << g() << std::endl; } } In Christ, Steven Watanabe