Boost logo

Boost :

From: Moore, Paul (paul.moore_at_[hidden])
Date: 2001-12-13 09:23:12


>>> BTW[2], I see no performance or dependency notes for
>>> the new GCD library (such as the rational library has).
>>> I'm not sure what implication this has on the rational
>>> class documentation, as now I cannot be explicit about
>>> performance or dependencies whenever I use gcd()
>>> (basically, everywhere). Can performance and dependency
>>> notes be added to the gcd library? And can someone check
>>> that no new dependencies, or worse performance, is added
>>> by the new library. I can then just point the rational
>>> documentation at the gcd documentation.
>>
>> Daryle?
>
>The new GCD function basically uses the same algorithm
>currently in the rational header. There is about 5 inline
>function call indirections, which should be optimized
>out. For dependencies, the rational header #includes
>a lot more headers than the GCD/LCM header. The only
>potential problem is that the rational header doesn't
>use std::numeric_limits, and the GCD/LCM header does use
>std::numeric_limits and needs its constants at compile
>time.
>
>Another difference is that the rational version always
>includes sign compensation, but the stand-alone version
>only has sign compensation if the type signals sign-ness
>with std::numeric_limits. Unknown types get a sign-ignorant
>version, which may lead to sign errors if the unknown type
>is really a signed number type.

Will you put this in the GCD documentation? I don't want to chop that chunk
out of rational and replace it with "see the GCD documentation" if the user
will then find it's not there...

Thanks,
Paul.


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