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

[SOLVED] Header file not found?

Tags: None
(comma "," separated)
matse
Registered Member
Posts
16
Karma
0
OS

[SOLVED] Header file not found?

Sat Jul 30, 2011 7:59 pm
Hello,
I wanted to solve a sparse system according to the tutorial here:
http://eigen.tuxfamily.org/dox/TutorialSparse.html

If I include

Code: Select all
#include <Eigen/UmfPackSupport>


I get the error that "#include <umfpack.h>" is not found (UmfPackSupport tries to include that header), so nevertheless since I guess in my case a cholesky decomposition would be better I tried:

Code: Select all
<Eigen/CholmodSupport>

Unfortunately this time "cholmod.h" was not found. So can anybody tell me what I made wrong? Do I need other libraries than eigen3 or is there another way of solving a (symmetric) sparse system?
Thanks,
matse

Last edited by matse on Sun Jul 31, 2011 12:53 pm, edited 1 time in total.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Header file not found?

Sat Jul 30, 2011 10:09 pm
for UmfpackSupport you need Umfpack, and same for CholmodSupport which requires Cholmod. In Eigen/SparseExtra there is SimplicialCholesky class for builtin LLT and LDLT solving.
matse
Registered Member
Posts
16
Karma
0
OS

Re: Header file not found?

Sat Jul 30, 2011 10:47 pm
Thanks for the reply! Do you mean this cholmod?

And what do you recommend me, using cholmod or SimplicialCholesky regarding speed?
Thanks,
matse
dmbates
Registered Member
Posts
24
Karma
0
OS

Re: Header file not found?

Sun Jul 31, 2011 3:50 am
matse wrote:Thanks for the reply! Do you mean this cholmod?

Yes, that is the cholmod library mentioned. It is not completely straightforward to compile and install. I wish I could have convinced Tim Davis to use a proper source code control system and include configure scripts. He has a tendency to formulate his own versions of things like templating systems and things start to fall apart if you don't have all the tools he assumes in exactly the right places.

If you are working on a Debian-based Linux system (which includes Ubuntu) you can obtain a binary package of cholmod and umfpack and a couple of others libraries like amd and colamd as the libsuitesparse-dev package.
And what do you recommend me, using cholmod or SimplicialCholesky regarding speed?
Thanks,
matse

Depends on the complexity of the system. I work with sparse least squares problems that can have millions of observations on hundreds of thousands of coefficients and Cholmod will do better on those problems. However, SimplicialCholesky is object-oriented and makes life much easier than pushing around pointers (including a pointer to a complicated configuration structure) as you end up doing in Cholmod. I mentioned in another posting on this forum that I think there is a serious memory bug in the solve methods for the CholmodDecomposition class (described in messages sent to the eigen mailing list) so I would avoid CholmodSupport until that is resolved.
matse
Registered Member
Posts
16
Karma
0
OS

Re: Header file not found?

Sun Jul 31, 2011 4:08 am
Hi,
so I've done a little bit of work and at first tried cholmod (had some trouble with the linker but finally got it working), the "LDLT" decomposition at least worked, with the "LLT" decomposition I encounter this bug:
http://eigen.tuxfamily.org/bz/show_bug.cgi?id=292

So nevertheless I tried SimplicialCholesky, because as you say it seems to be easier to use, so what I did here was:

Code: Select all
Eigen::SparseMatrix<float> M;
  //filling M --> M is a 43 x 43 sparse matrix
Eigen::SparseVector<float> V;
  //filling V --> V is a 43x1 column sparse Vector

Eigen::SparseVector<float> x;
x = Eigen::SimplicialCholesky<Eigen::SparseMatrix<float> >(M).solve(V);


But unfortunately this results in the following error:
main.cpp:40:72: error: no matching function for call »Eigen::SimplicialCholesky<Eigen::SparseMatrix<float, 0, int> >::solve(Eigen::SparseVector<float>&)«


I guess I made a "major mistake", do I use wrong classes or why does this not work?
I have to say that the cholesky decomposition alone:
Code: Select all
Eigen::SimplicialCholesky<Eigen::SparseMatrix<float> > cholM(M);

works, so can anybody give me advice?
Thanks
matse
dmbates
Registered Member
Posts
24
Karma
0
OS

Re: Header file not found?

Sun Jul 31, 2011 4:29 am
matse wrote:Hi,
so I've done a little bit of work and at first tried cholmod (had some trouble with the linker but finally got it working), the "LDLT" decomposition at least worked, with the "LLT" decomposition I encounter this bug:
http://eigen.tuxfamily.org/bz/show_bug.cgi?id=292

So nevertheless I tried SimplicialCholesky, because as you say it seems to be easier to use, so what I did here was:

Code: Select all
Eigen::SparseMatrix<float> M;
  //filling M --> M is a 43 x 43 sparse matrix
Eigen::SparseVector<float> V;
  //filling V --> V is a 43x1 column sparse Vector

Eigen::SparseVector<float> x;
x = Eigen::SimplicialCholesky<Eigen::SparseMatrix<float> >(M).solve(V);


The solve methods for sparse vectors have not yet been written but it is unlikely that there would be any advantage in using a SparseVector representation of a vector of dimension 43. Just declare V to be a VectorXf


But unfortunately this results in the following error:
main.cpp:40:72: error: no matching function for call »Eigen::SimplicialCholesky<Eigen::SparseMatrix<float, 0, int> >::solve(Eigen::SparseVector<float>&)«


I guess I made a "major mistake", do I use wrong classes or why does this not work?
I have to say that the cholesky decomposition alone:
Code: Select all
Eigen::SimplicialCholesky<Eigen::SparseMatrix<float> > cholM(M);

works, so can anybody give me advice?
Thanks
matse
matse
Registered Member
Posts
16
Karma
0
OS

Re: Header file not found?

Sun Jul 31, 2011 12:53 pm
Thank you so much, dmbates! Works really fine, you just saved my day ;)

Unfortunately this was just a "test vector", so the real "vector" will be much bigger, but nevertheless it works now and I will see how it performs later.

Thanks for the great support here,
matse


Bookmarks



Who is online

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