Boost logo

Boost :

Subject: Re: [boost] [math distributions] where to check for validity of distribution variables?
From: Thijs van den Berg (thijs_at_[hidden])
Date: 2008-11-21 15:46:22

>>> What do you think? We might turn "having valid parameters" into a
>>> property of *all*
>>> distribution. As an alternative, we might add a non member function
>>> bool valid<distributionType...
>>> but that wouldn't allow for caching validation in e.g. a constructor
> Sounds fine to me.
thats great! What's your opinion on the fact that you can only set
parameter in the constructor?
E.g. the normal distribution does a parameter check in the constructor,
and those parameters
can't change after that.
I'll work out the parameter idea in the Laplace distribution code...
>>> In general (but in the scope of the constructs used in
>>> math/distributions & its non member
>>> functions): what are the arguments for placing code in either member
>>> or non-member functions ?
> For implementation details, use whatever works best, for interfaces
> non-members that operate uniformly on a range of types seem to work best.
> John.
that's very pragmatic! I like that, thanks

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