![]() Registered Member ![]()
|
I am developing some code that inverts matrices, which can be ill-conditioned. In some scenarions I understand that Cholesky will fail, I guess roundoff errors may make a value negative etc.. In these cases the algorithmn will fail. Always the matrix is sqaure and positive definite. It is an autocorrelation matrix.
Is there any way in Eigen for the matrix that can be processed to be returned? Meaning if I have a 125x125 matrix and due to numerical errors only 50x50 can be processed then I would like to use that. If not, how easy would something like this be for me to add to the code? Thanks. |
![]() Moderator ![]()
|
Actually, LLT internal implementation already returns the first failing row/column index, see:
https://bitbucket.org/eigen/eigen/src/1 ... ult#cl-357 so instead of checking if it is equal to -1 for success you can easily adapt the code to record this value and return it to the user. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]