Boost logo

Boost :

Subject: Re: [boost] How to generate a Bernuolli number
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-03-31 21:09:56


AMDG

Barco You wrote:
> Hi Henning,
>
> Thanks for your reply!
> but,
> g = generator(rng, boost::bernoulli_distribution<>(p));
>

Try
  g.distribution() = boost::bernoulli_distribution<>(p);
or just construct the variate generator whenever you need
a random number:
  std::cout << generator(rng, boost::bernoulli_distribution<>(p))() <<
std::endl;

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk