Boost logo

Boost Users :

Subject: Re: [Boost-users] [Math/Statistical Distributions+Random] Random number generation
From: er (erwann.rogard_at_[hidden])
Date: 2009-08-16 01:45:34


Marco Guazzone wrote:

> I think a function like this below would be very helpful:
> --- [snip] ---
> template <typename Generator, typename RealType, typename Policy>
> inline RealType rand(Generator& rng, const
> exponential_distribution<RealType, Policy>& dist)
> {
> return -1.0 / dist.lambda() * std::log(1.0-rng());
> }

Here's something similar:
https://svn.boost.org/svn/boost/sandbox/statistics/dist_random/


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