Boost logo

Boost :

Subject: Re: [boost] Introduction of numeric_adaptor
From: Bruno Lalande (bruno.lalande_at_[hidden])
Date: 2009-11-07 03:52:56


Hi John,

Just tried Boost.Math bindings. Technically, they do exactly the same
thing as our numeric_adaptor indeed:
- providing a wrapper class to make bignumbers behave like any number
- ensure std functions can be performed on them
- and in addition to ours, does the same for Boost.Math functions as well

So I'm definitely interested. The only thing that disturbs me is about
the way in which std functions must be invoked. One purpose of
numeric_adaptor is to provide a common namespace (boost, but might be
anything) from which library writers can call those functions (I place
myself from the point of view of a function template that doesn't know
in advance what type in gets in input). So:

boost::sqrt(n); // works with fundamental types, GMP types, CLN types, etc...

In Boost.Math bindings, those functions have a specific namespace for
each specific type provided. So a library writer doesn't know what to
type:

std::sqrt(n); // if it's a fundamental type
boost::math::ntl::sqrt(n); // if it's a boost::math::ntl::RR type
etc....

But maybe the principle of your bindings is that the library writer
only relies on ADL, and thus always simply writes "sqrt(n)"? If it's
the case and if you think this is an acceptable way to do, then I
would definitely adopt Boost.Math bindings.

Regards
Bruno


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