Boost logo

Boost :

Subject: Re: [boost] [math] & [random] distribution object compatibility
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2014-04-14 13:46:02

> -----Original Message-----
> From: Boost [mailto:boost-bounces_at_[hidden]] On Behalf Of Thijs van den
> Berg
> Sent: 13 April 2014 19:46
> To: boost_at_[hidden]
> Subject: Re: [boost] [math] & [random] distribution object compatibility
> > AMDG
> >
> > On 04/13/2014 07:36 AM, Thijs van den Berg wrote:
> >> Boost [random] has probability distribution objects for drawing random
> of those distributions. Boost [math] also has probability distributions, those
> free functions for computing properties of the distributions, like mean, pdf
> >>
> >> I like the free function design of math variant e.g. it uses
pdf(distribution,x) and I
> was wondering why this hasn't been adopt in C++11 for <random>? To me a free
> function syntax like random(distribution,engine) would make sense. It would
> with the fact that C++11 has added begin(container) and end(container) free
> functions.
> >>
> >> I think it's a bit inconvenient to have two libs that both contain
> distributions.

Indeed - but the requirements are quite different.

Boost.Math aims to be accurate (and with extension to use Boost.Multiprecision
and <cstdfloat> , very, very accurate).

Boost.Random must be very fast, but need not be accurate - indeed it may be
rather inaccurate?

So I doubt if changing either is a good idea.

(And anyway they are by different authors developed at different times - so NIH
probably applies).


Paul A. Bristow
Prizet Farmhouse
Kendal UK LA8 8AB
+44 01539 561830

Boost list run by bdawes at, gregod at, cpdaniel at, john at