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

LDLT decomposition

Tags: None
(comma "," separated)
gabrielvc
Registered Member
Posts
6
Karma
0
OS

LDLT decomposition

Tue Mar 02, 2010 11:42 pm
I am using the cholesky decomposition LDLT in my code. I followed the tutorial at http://eigen.tuxfamily.org/dox/Tutorial ... gebra.html, the section of cholesky. If I define the decomposed matrices as:

Eigen::LLT<MatrixXd> ldlteigenrigid(eigenRigid);

The program runs. How should I run for LDLT? Whe I use

Eigen::LDLT<MatrixXd> EIRI;

I obtain a criptic error:

globalFEM.h:41: error: no matching function for call to 'Eigen::LDLT<Eigen::Matrix<double, 10000, 10000, 2, 10000, 10000> >::LDLT()'

How should I use it? Thanks,
User avatar
bjacob
Registered Member
Posts
658
Karma
3

Re: LDLT decomposition  Topic is solved

Wed Mar 03, 2010 12:59 am
Indeed, there is a little discrepancy in the API of Eigen 2.0: while LLT has a default constructor and allows you to compute the decomposition afterwards with compute(), this is not the case with LDLT. Instead you must pass the matrix to the constructor.

So:
Code: Select all
LDLT<MatrixXd> myLdlt(myMatrix);


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
gabrielvc
Registered Member
Posts
6
Karma
0
OS

Re: LDLT decomposition

Wed Mar 03, 2010 1:05 am
Thanks for the answer, Jacob. Then my only solutions is to have the LDLT and the loop over the different vectors on the same function? As of now I had my code organized in such a way that one function created the LDLT object and another one calculated the loop over the different vectors.
User avatar
bjacob
Registered Member
Posts
658
Karma
3

Re: LDLT decomposition

Wed Mar 03, 2010 1:11 am
Yes, unfortunately, with Eigen 2.0, that's your only solution ... :( But in the development branch (pre-3.0) there is a default constructor so you might consider using that. It is more powerful, tooo (it does pivoting).

-Benoit


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
gabrielvc
Registered Member
Posts
6
Karma
0
OS

Re: LDLT decomposition

Wed Mar 03, 2010 4:01 am
Thanks Benoit,

I have troubles building the examples for eigen3. At the source:

gavox@NyarlHotep:~/software/eigen/demos$

I type cmake . and obtain:

-- Configuring done
-- Generating done
-- Build files have been written to: /home/gavox/software/eigen/demos

Now type make and got errors:

[ 12%] Building CXX object mandelbrot/CMakeFiles/mandelbrot.dir/mandelbrot.o
In file included from /home/gavox/software/eigen/demos/mandelbrot/mandelbrot.cpp:25:
/home/gavox/software/eigen/demos/mandelbrot/mandelbrot.h:28:23: error: Eigen/Array: No such file or directory
In file included from /home/gavox/software/eigen/demos/mandelbrot/mandelbrot.cpp:25:
/home/gavox/software/eigen/demos/mandelbrot/mandelbrot.h:54: error: 'Eigen' has not been declared
/home/gavox/software/eigen/demos/mandelbrot/mandelbrot.h:54: error: ISO C++ forbids declaration of 'Vector2d' with no type
/home/gavox/software/eigen/demos/mandelbrot/mandelbrot.h:54: error: expected ';' before 'center'
/home/gavox/software/eigen/demos/mandelbrot/mandelbrot.h: In constructor 'MandelbrotWidget::MandelbrotWidget()':
/home/gavox/software/eigen/demos/mandelbrot/mandelbrot.h:70: error: cl

and lot more. As if it would not find eigen. I did an install in /usr/local/include/eigen3/.
User avatar
bjacob
Registered Member
Posts
658
Karma
3

Re: LDLT decomposition

Wed Mar 03, 2010 4:24 am
We haven't even tried building the demos in the devel branch in a loooonng time. We'll probably fix it just before the 3.0 release.


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]