|
Boost : |
Subject: Re: [boost] [review] Multiprecision review (June 8th - 17th, 2012)
From: Mario Mulansky (mario.mulansky_at_[hidden])
Date: 2012-06-28 10:37:13
Hi
On Friday, June 08, 2012 04:28:09 PM Jeffrey Lee Hellrung, Jr. wrote:
> Okay, it's that time. Apologies for not sending a reminder, but there had
> been a lot of pre-review comments over the last week or so, so I think this
> has been on at least some people's radar. The original review announcement
> is given below.
I hope it is not too late to give a short brief review of my experience with
the Multiprecision library. First a general comment: this review is from a
"naive user" perspective who just wants to use multiprecision and is happy
finding a C++ library for that.
My test case is to use floating point multiprecision types as the basis for
our odeint library (www.odeint.com). As odeint is fully templatized I could
just plug in, say, the cpp_dec_float_50 and the basic routines worked out of
the box. The only problem I had was that there seems to be no support for min
/ max functions for expressions of multiprecision types. So can not write
x = max( a+b , a*b )
when x,a,b are some mp types, however
a1 = a+b
a2 = a*b
x = max( a1 , a2 )
works and I used it as a workaround, however I would like to see full support
of min/max in Multiprecision (maybe I just missed something?)
I can not say anything on the design or implementation as I did not look into
it. May only remark is that the design is such that mp types work nicely with
large numerical libraries and the implementation seems to be robust.
Some basic performance test of cpp_dec_float_50 vs mpf_float_50 gave me a
factor of about 1.8 in favor of mpf, as expected from what I read in the docs.
As for the documentation I didn't go beyond the introduction, because I didn't
need too. This is exactly how it should be, if you just want to use a library
the Introduction/Tutorial should be all you have to read.
To conclude this very brief review, I would be happy to see this library
becoming a part of boost.
Best, Mario
>
> On Tue, May 29, 2012 at 2:08 PM, Jeffrey Lee Hellrung, Jr. <
>
> jeffrey.hellrung_at_[hidden]> wrote:
> > Hi all,
> >
> > The review of the proposed Boost.Multiprecision library authored by John
> > Maddock and Christopher Kormanyos has been scheduled for
> >
> > June 8th - June 17th, 2012
> >
> > and will be managed by myself.
> >
> > From the Introduction:
> >
> > --------
> > "The Multiprecision Library provides *User-defined* integer, rational and
> > floating-point C++ types which try to emulate as closely as practicable
> > the C++ built-in types, but provide for more range and precision.
> > Depending upon the number type, precision may be arbitrarily large
> > (limited only by available memory), fixed at compile time values, for
> > example 50 decimal digits, or a variable controlled at run-time by
> > member functions. The types are expression-template-enabled for better
> > performance than naive user-defined types."
> > --------
> >
> > And from the original formal review request from John:
> >
> > --------
> > Features:
> >
> > * Expression template enabled front end.
> > * Support for Integer, Rational and Floating Point types.
> >
> > Supported Integer backends:
> >
> > * GMP.
> > * Libtommath.
> > * cpp_int.
> >
> > cpp_int is an all C++ Boost licensed backend, supports both arbitrary
> > precision types (with Allocator support), and signed and unsigned fixed
> > precision types (with no memory allocation).
> >
> > There are also some integer specific functions - for Miller Rabin
> > testing, bit fiddling, random numbers. Plus interoperability with
> > Boost.Rational (though that loses the expression template frontend).
> >
> > Supported Rational Backends:
> >
> > * GMP
> > * libtommath
> > * cpp_int (as above)
> >
> > Supported Floating point backends:
> >
> > * GMP
> > * MPFR
> > * cpp_dec_float
> >
> > cpp_dec_float is an all C++ Boost licensed type, adapted from Christopher
> > Kormanyos' e_float code (published in TOMS last year).
> >
> > All the floating point types, have full std lib support (cos sin exp, pow
> > etc), as well as full interoperability with Boost.Math.
> >
> > There's nothing in principal to prevent extension to complex numbers and
> > interval arithmetic types (plus any other number types I've forgotten!),
> > but I've run out of energy for now ;-)
> >
> > Code is in the sandbox under /big_number/.
> >
> > Docs can be viewed online here:
> > http://svn.boost.org/svn/boost/sandbox/big_number/libs/multiprecision/doc
> > /html/index.html --------
>
> Any review discussion should take place on the developers' list (
> boost_at_[hidden]), and anyone may submit a formal review, either
> publicly to the entire list or privately to just myself.
>
> As usual, please consider the following questions in your formal review:
>
> What is your evaluation of the design?
> What is your evaluation of the implementation?
> What is your evaluation of the documentation?
> What is your evaluation of the potential usefulness of the library?
> Did you try to use the library? With what compiler? Did you have any
> problems?
> How much effort did you put into your evaluation? A glance? A quick
> reading? In-depth study?
> Are you knowledgeable about the problem domain?
>
> And, most importantly, please explicitly answer the following question:
>
> Do you think the library should be accepted as a Boost library?
>
> Lastly, please consider that John and Christopher have compiled a TODO list
> [1] based on pre-review comments. Feel free to comment on the priority and
> necessity of such TODO items, and whether any might be show-stoppers or
> warrant conditional acceptance of the library.
>
> Thanks in advance; looking forward to the discussion!
>
> - Jeff (& John & Christopher)
>
> [1]
> http://svn.boost.org/svn/boost/sandbox/big_number/libs/multiprecision/doc/h
> tml/boost_multiprecision/map/todo.html
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk