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

Compile error with fullPivLu().solve(b) using mpf_class type

Tags: None
(comma "," separated)
Munich
Registered Member
Posts
3
Karma
0
I am trying to solve a linear systems of equations using the fullPivLu method while using a mpf_class (gmp c++ - https://gmplib.org/) type:

Matrix <mpf_class, Dynamic, Dynamic> A(10,10);
// set A values ...
Matrix <mpf_class, Dynamic, 1> b(10);
// set b values ...
Matrix <mpf_class, Dynamic, 1> x(10);
x = A.fullPivLu().solve(b);

When I compile (in VS2013) I get C2593 'operator *' is ambiguous on line 286 in FullPivLU.h (version 3.2.9). When I use a double type it works. If I use the partialPivLu() method with mpf_class it works. However, I do need the added precision of fullPivLu().

Is there a way to get this to work?

Thanks!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
You might try 3.3-rc1 which is more flexible regarding custom scalar types.
Munich
Registered Member
Posts
3
Karma
0
Okay, I'll give that a shot. I'll report back.
Munich
Registered Member
Posts
3
Karma
0
Unfortunately, I get the same error :( with 3.3-rc1.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
I finally gave it a try, and the following self-contained example is compiling fine with GCC and clang, using either eigen 3.2 or 3.3, gmp 6.1.

Code: Select all
#include <Eigen/Dense>
#include <gmpxx.h>
using namespace Eigen;

int main()
{
  Matrix <mpf_class, Dynamic, Dynamic> A(10,10);
  Matrix <mpf_class, Dynamic, 1> b(10);
  Matrix <mpf_class, Dynamic, 1> x(10);
  x = A.fullPivLu().solve(b);
}



Bookmarks



Who is online

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