Registered Member
|
Hi,
How I can efficiently invert a sparse lower triangular matrix ? My matrixes are large (size up to a million) and very sparse. The context I try to implement an Incomplete Cholesky Preconditionner to feed a Preconditionned Conjugate Gradient solver. The Incomplete Cholesky Preconditionner is explained here http://en.wikipedia.org/wiki/Incomplete ... torization 1) I have a matrix A, ok. Cholesky magic, I got a matrix L which is lower triangular. 2) I generate a matrix K from L and A, K is also lower triangular. 3) I invert K 4) Profit ! I miss the step 3) The code Here is is my attempt at doing the stuff described in Wikipedia
|
Moderator
|
If your matrix is sparse lower triangular, and you want to compute X = A^-1 B simply do:
X = A.triangularView<Lower>.solve(B); No need to explicitly invert it. Moreover, the inverse of a sparse matrix can be very dense, so it is really not recommended to try to compute its inverse. |
Registered Member
|
Thank you, indeed, makes sense !
So, for those who came here with the same question, here it is the code I used, to compute X = M^-1 * B:
Note than you can do that too:
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]