Boost logo

Boost :

Subject: Re: [boost] [math distributions]
From: Thijs van den Berg (thijs_at_[hidden])
Date: 2008-11-28 09:17:50


Paul, John,

Having looked at parts of the code in math:distributions, I have some
questions regarding coding in

1) Assignments:
shouldn't we replace occurrences like
    RealType result scale = dist.scale();
with
    RealType result scale(dist.scale());

2) The range() and support() non-member function return "*const*
pair<>", all others return *non*-const RealType,
Shouldn't all of them be const?

3) This is one will have quite a bit of impact...
In common_error_handling.hpp
in the function inline bool check_XXX(const char* function, RealType
const& prob, RealType* result, const Policy& pol)
shouldn't we replace
    RealType* result,
with
    RealType& result,
(and adjust all the calls)
to ensure that result has a valid address?

Cheers, Thijs

PS, I see no LambertW function in math::special_function. I'm sure Knuth
is going to be very upset! :)

-- 
SITMO Quantitative Financial Consultancy - Software Development
M.A. (Thijs) van den Berg
Tel.+31 (0)6 2411 0061
Fax.+31 (0)15 285 1984
thijs_at_[hidden] <mailto:thijs_at_[hidden]> - www.sitmo.com 
<http://www.sitmo.com>


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