Boost logo

Boost Users :

From: Matthias Troyer (troyer_at_[hidden])
Date: 2008-03-28 15:43:37


On 25 Mar 2008, at 19:53, Tim Keitt wrote:
> I've often wondered this myself (not the how, but the why). This is
> a rather odd
> feature of the Boost Random library. Most libraries would have a
> function list
> "rnorm(mean, std)" which would return a random deviate with the
> specified mean
> and standard deviation. Changing these at runtime is important for
> many kinds of
> simulation. You can of course define these yourself eg
>
> double rnorm(double mean, double std)
> {
> return std * rnorm01() + mean;
> }
>
> where rnorm01() returns deviates with unit scaling and zero mean.
> This works if
> the scaled distribution is affine to the original, but does not work
> otherwise
> (if the distribution changes shape with the parameters).
>
> This is an area where Boost Random needs some TLC. Good idea for a
> SoC project!

Distributions in Boost.Random do just that.

Matthias


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net