|Re: [eigen] Arbitrary precision arithmetic support in Eigen|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Arbitrary precision arithmetic support in Eigen
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Wed, 14 Jul 2010 16:06:19 +0200
- Cc: Pavel Holoborodko <pavel@xxxxxxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=KlD4a1iEH8ga6RwcjgqZCs8UYqv6Gqt+rR3RLWO1zc8=; b=PoRZnevqr/Z0IiKjF9CBaVJqJ5cpk6IsQnV5wtywE70Ecltu8OAM9mLSiPjWXE+WvN h3d006y9U6+M34e9u9LZokRi2iC/n164XxYcI6TJpDaTCspLEm0GlMdRsWqweac27zmk mfrPO2F3L3g71w7AE5NLRaj5QQr/YlyVO5480=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=gcihG3E5JS2SSmgu1pBetrOHizbimVDZ5icy4NJLK9t6kSWz2DYLfUZqJf7iI0NVDC DbJhVQ3i2oPY0zF+AySoqvQw0UtTKARTXj3BmTpgZ4qWKOJGSGa5ZI8OD+ixvl8PUXZf bAtoEQwM36JDwP4yzjJM+6tgIhztC/dxrG7XI=
thank you for your email. This is excellent!
Actually, the possibility to use arbitrary precision scalar types is
one of the main argument I often use to sell Eigen. So having an
officially supported module for your lib with extensive testing is
something I wanted to do for a while, but you know there are always so
many things to do.
So I'm really glad to see you added support for Eigen ;) I will add a
word on the website.
What to do next?
You said there is a lack of extensive testing. Since all our efforts
are now focused on the next Eigen version, Eigen3 which should be
release within a few months I'd rather spend time testing MPFR support
on Eigen3 than Eigen2. However, the way to add support for custom
scalar types slightly change. Fortunately, based on your current
support header file this should not be difficult. I can have a look at
One leading question is where to put such an header file? Within Eigen
as a (MpfrSupport module) or as a standalone file as it is currently
the case? The main advantage I see in having it in Eigen itself is
that should simplify to had full and continuous testing What do you
Finally, once MPFR C++ will use expression template, adding a good
support for Eigen-MPFR C++ that leverages ET at both the matrix and
scalar type level will be more tricky because Eigen will have to know
about the returned expression types of the mpreal operations. We
currently do not have an easy solution for that but this is something
we have to workout anyway for many other use cases (e.g., to nest
Eigen's Matrix/Array types, for automatic differentiation, etc.)
On Wed, Jul 14, 2010 at 7:01 AM, Pavel Holoborodko
> Hello Everyone!
> First of all I would like to thank all the developers for the this
> beautifully designed and implemented library!
> I've learned a lot looking over it.
> I'm developer of C++ interface for the arbitrary precision floating point
> arithmetic library MPFR: http://www.holoborodko.com/pavel/?page_id=12.
> During last year I've received couple of questions from the users on how to
> use my wrapper together with Eigen. There was discussion in KDE forum on the
> topic but it seems that not all problems were solved:
> Recently the most complete (hopefully:)) bridge for embedding mpreal type
> into Eigen was created.
> Please check home page under "Software using MPFR C++" for header file
> So, now user can equip Eigen with arbitrary precision arithmetic by:
> 1. Installing MPFR and GMP libraries.
> 2. Using MPFR C++ interface (mpreal.h, mpreal.cpp) along with header file
> 3. Using mpreal type (provided by MPFR C++) instead of built-in type double
> or float.
> Precision (number of bits used for significant) can be setup globally by
> For instance double has only 53 bits precision with machine epsilon 1e-16
> (maximum 16 correct digits).
> Using mpreal user can do calculations with any precision, e.g. 1024 bits
> with machine epsilon 1e-309 (309 correct digits).
> I would appreciate if someone who intensively use/develop Eigen would test
> how MPFR C++ works with Eigen.
> Any suggestions for improvement, test reports, etc. are very very welcome.
> Also I would appreciate if Eigen webpage or documentation will reference
> such possibility on using arbitrary precision arithmetic.
> I think, this option could be very useful for the users.
> Besides reference on my site would give me huge support and motivation for
> further improvement.
> All the best,
> Pavel Holoborodko.
> I'm planning to release new version of MPFR C++ soon based on expression
> templates inspired by Eigen.