|
Boost : |
From: Paul A Bristow (pbristow_at_[hidden])
Date: 2008-03-31 09:57:49
>-----Original Message-----
>From: boost-bounces_at_[hidden]
>[mailto:boost-bounces_at_[hidden]] On Behalf Of Kevin Sopp
>Sent: 30 March 2008 11:04
>To: boost_at_[hidden]
>Subject: [boost] [mp_math] a multi precision signed integer library
>
>I've been busy with porting the public domain C library libtommath to
>C++. The code is quite usable as it is and some simple documentation
>exists in the libs/mp_math/doc/html subfolder. I've implemented all
>C++ operators for the mp_int<> type and it can thus be used just like
>a built-in integer type. Some things like random number generation and
>primality testing have not been documented yet.
>Please have a look, I'm looking for feedback at the moment so that I
>can plan on how to proceed.
>
>http://www.boost-consulting.com/vault/index.php?action=download
>file&filename=mp_math_v01.zip&directory=Math%20-%20Numerics&
>
>alternatively go to boost vault /math - numerics subfolder and
>download mp_math_v01.zip
Of course, this is interesting in that Boost 'needs' an arbitrary precision arithmetic package in its library.
John Maddock's Math Toolkit would not have been possible without NTL, a GPL library providing similar facilities, to calculate high
accuracy coefficients and test values. And the Math Toolkit can be used with NTL (with some very minor modifications) by those who
can accept the GPL license terms.
(Aside - we have asked the author of NTL Victor Shoup to change the licence terms of at least the basic int and float facilities to
Boost - but without success so far.)
But it would be much nicer to have a package that fits seemlessly into the Boost package.
I have not looked at this in detail but it looks promising for the integer requirements. I am not qualified to judge the
compromises between design and efficiency, as mentioned by Maarten Kronenburg, but this library seems to fit in with the header-only
and template/container design used by most Boost libraries.
But there have been several unfinished big-integer attempts and I think you need to say why you think this one is better/more nearly
finished.
The tests are fine, but are no substitute for a lot more user examples and discussion of how to use fancier features are vital.
However it does not address the floating point needs - yet.
In order to be *really* useful, a 128 (and perhaps 256) fixed precision, and an arbitrary precision floating-point library is also
needed, and preferably for better speed also a 128, and perhaps 256 fixed precision). But perhaps you are tired from your work so
far ;-) Google Summer of Code project?
Paul
PS (A cosmetic detail is that none of the files include the Boost License but that will be easily fixed. It might be desirable to
have an explicit agreement to these terms for any of Tom's C code used or referenced too.)
PPS A check of your simplest demo program worked MSVC 2003, but produced an off-putting and worrying blizzard of warnings even at
the default level 3 - these could (and should) be easily fixed by explicit casting.
--- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk