Boost logo

Boost :

From: Tarjei Knapstad (tarjeik_at_[hidden])
Date: 2003-04-14 09:39:47


On Wed, 2003-04-09 at 21:42, Paul A. Bristow wrote:
> Following discussions with Walter Brown, who made a previous proposal for some
> math functions (adding to the C99 functions proposed by P J Plauger),
> I have prepared a draft of a new proposal to add a good number of other 'special
> functions' which I believe have even greater practical utility (but perhaps more
> difficulty in implementation).
>
Most of these aren't too hard to implement IIRC, but I have one remark.
In your proposal you state that overloads would be preferable to
function templates. To my knowledge though, all these functions sooner
or later relies on a uniform random number generator (for instance the
normally distributed number is usually computed using two uniformly
random numbers).

My question is, which random number generator should be used in the
implementation of these distributions? IMHO, ideally this should be left
to the user to decide. Wouldn't that facilitate something more in the
ways of:

template<typename T, class Functor = DefaultRNG>
T normal_distribution(T z);

and so on? (I understand you want to keep interoperability with C, this
is just a C++ example)

Cheers,

--
Tarjei Knapstad

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