Boost logo

Boost :

From: Christoph Ludwig (cludwig_at_[hidden])
Date: 2005-03-08 10:10:51


On Sat, Mar 05, 2005 at 02:31:59PM +0100, Richard Peters wrote:
> From: "Christoph Ludwig" <cludwig_at_[hidden]>
> > * Did I miss the functions that convert big_integer to long, double etc.?
> And
> > the other way around, how can I convert a double to a big_integer?
> (Such
> > conversion functions are essential in my area of interest, lattice
> basis
> > reduction.)
>
> I don't have functions converting to/from floating point types. Actually, I
> have never had the need for floating point values,

In lattice reduction, you work on Gram-Schmidt decompositions of (big_)integer
matrices where the rank is several hundreds. The Gram-Schmidt coefficients are
rational, but in high dimensions it is way too expensive to keep them in exact
arithmetic. Therefore, the Schnorr-Euchner variant of the
Lenstra-Lenstra-Lovasz algorithm stores the Gram-Schmidt decomposition in
(preferably hardware) floating point arithmetic. But eventually all
transformations applied to the floating point approximations need to be
applied to the integer matrix as well. That is why you need integer / floating
point conversions for this type of application.

> and I'm wouldn't know how
> to implement them. If you'd like, I can contact you when I resume work on
> this library, so that we can work something out.

Right now I use NTL <url:http://www.shoup.net/ntl/index.html> for my
programs. I didn't check how it performs the bigint / double conversions but
it also supports gmp as core library. So it should be possible for your
library as well.

Regards

Christoph

-- 
http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/cludwig.html
LiDIA: http://www.informatik.tu-darmstadt.de/TI/LiDIA/Welcome.html

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