This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Eigen + mpreal

Tags: None
(comma "," separated)
CCTsai
Registered Member
Posts
3
Karma
0
OS

Eigen + mpreal

Wed Jun 15, 2011 7:14 am
Dear all,

I tested mpreal + Eigen3.0.0 by considering mpreal version of qr.cpp, qr_fullpivoting, jacobisvd.cpp, eigensolver_selfadjoints.cpp, eigensolver_generic.cpp, eigensolver_complex.cpp, inverse.cpp, determinant.cpp, cholesky.cpp, lu.cpp and mpreal_supports.cpp. Basically, they work very well, except the jacobisvd_preallocate() in mp_jacobisvd.cpp. Of course, I fixed the ceil() problem memtioned by Pavel Holoborodko.

In addition, I added boost/math/special_functions.hpp through boost/math/bindings/mpreal.hpp to my codes in these tests. Their collaboration are excellent.

I appreciate the innovation of the Eigen library and the mpreal library. I believe the uniquely best multiple-precision mathematics on the planet is Eigen + mpreal + boost/math/special_functions.hpp.

CC Tsai, Taiwan
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Eigen + mpreal

Thu Jun 16, 2011 5:59 am
thank you for the feedbacks! I'll add JacobiSVD in the unit test of mpreal_support and see what's going wrong...
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Eigen + mpreal

Thu Jun 16, 2011 6:21 am
hm... what is "jacobisvd_preallocate() in mp_jacobisvd.cpp" ?? is it something in Eigen? Here Eigen's JacobiSVD works well with mpreal.
CCTsai
Registered Member
Posts
3
Karma
0
OS

Re: Eigen + mpreal

Thu Jun 16, 2011 2:45 pm
I simply changed all double and float to mpreal in jacobisvd.cpp. For example, Matrix2f was changed to Matrix2mp, which was typedefined by Matrix<mpreal,2,2>. And renamed jacobisvd.cpp to mp_jacobisvd.cpp. Then, I find the mp version of non-template jacobisvd_preallocate() had problem.

ps: mpreal + Eigen 3.0.1 have a lot of problems.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Eigen + mpreal

Fri Jun 17, 2011 6:34 am
ps: mpreal + Eigen 3.0.1 have a lot of problems.


yes, these issues have been solved recently (you can checkout the latest 3.0 branch)
CCTsai
Registered Member
Posts
3
Karma
0
OS

Re: Eigen + mpreal

Tue Aug 30, 2011 6:13 am
Dear All,

I tried one more time about the Eigen + mpreal + boost/math/special_functions.hpp. Now, I should correct my previous report.

The combination of Eigen and mpreal is not yet perfect but is in the right way. For example, the complex<mpreal> needs to be added.

On the other hand, the combination of mpreal and boost/math/special_functions.hpp could be perfect if I changed the mpfr::abs() and mpfr::sqrt() to std::abs() and std::sqrt().

Therefore, there is an obvious conflict among Eigen, mpreal and boost/math/special_functions.hpp. As a user, I cannot find an easy solution if the three sides do not have a communication.

Anyway, thanks for the innovation of the three great libraries.

Tsai
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Eigen + mpreal

Wed Aug 31, 2011 6:45 am
I don't know about boost/math/special_functions, but if they cannot deal with abs(), sort() and the like being defined in the scalar type namespace, then that's there problem. Basically they should replace calls like:

std::abs(x);

to:

// beginning of the function:
using std::abs;
...
abs(x)


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]