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

Diagonal entries of Cholesky factor

Tags: None
(comma "," separated)
lucastheis
Registered Member
Posts
1
Karma
0

Diagonal entries of Cholesky factor

Sat Jun 01, 2013 2:00 pm
Hi,

what is the best way to get the diagonal entries of the Cholesky factor of a matrix? I'm using

Code: Select all
MatrixXd(A.llt().matrixL()).diagonal()

since neither LLT nor TriangularView seem to offer a diagonal() method, but it's a bit cumbersome.

Thanks a lot!

Lucas
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
TriangularView could indeed offer a diagonal() method. In the meantime it's better to get the underlying matrix rather than copying it into a temporary:
Code: Select all
A.llt().matrixL().nestedExpression().diagonal()


Bookmarks



Who is online

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