Registered Member
|
Hi,
I wasn't able to find clear documentation on LDLT. I was hoping you could help me please. In this code I'm trying to find the squre root of a positive semidefinite matrix:
These lines fails to compile:
The operator * is undefined on that object. I had to assign it to a temporary matrix first. Is that expected bahaviour? Also, I wondered why LDLT provides the method transpositionsP() of type TranspositionType rather than a PermutationMatrix type. I assume that I can still use it as a regular a matrix in this line
Is there a way to get an actual matric object from it? Like this...
Finally, what's the difference between the methods transpose() and inverse() for type TranspositionType? Is there a build in to find the sqrt of a PSD matrix?? Thanks! Raman |
Moderator
|
For teh sqrt matrix operator look at this function:
http://eigen.tuxfamily.org/dox/classEig ... 8b2d2b0775 Regarding your issue, triangular times diagonal is not supported. You need to copy the L factor to a full matrix first:
You can copy a Transpositions object to a PermutationMatrix through ctor or operator=:
but why would you sore a permutation matrix into a dense matrix? |
Registered Member
|
Hi ggael,
Thanks a lot. I didn't need a dense representation of P. I only wanted to print (cout) the permutation matrix our some representation of the permutation. So is there a way to do that. I guess I could multiply it to an identity matrix and print the result. Is there a difference between inverse and transpose for the TranspositionType? thanks! Raman |
Moderator
|
The solution I showed you is faster than multiplying by the identity.
transpose and inverse are obviously the same for a permutation matrix. having both permits to write generic code. And, again don't miss the operatorSqrt function that does what you're looking for. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]