Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6996 Discussions

Matrix inversion algorithm for ill-conditioned matrices

GeekVampi
Beginner
831 Views
Hi,

I am looking for fastest algorithm for general matrix inversion. The matrices (mid size), I will be inverting, are badly ill conditioned. And I need to do this matrix inverse several times in one call of my subroutine. Can anyone suggest me some algorithm or any routine in MKL that can do this job efficiently and accurately. I know of "getrf" and "getri" in MKL but I am not sure whether it will be good for badly ill conditioned matrices or not.

Thanks
0 Kudos
3 Replies
Michael_C_Intel4
Employee
831 Views

Hi,

the fastest way to inverse matrix is surely dgetrf/dgetri. If you need just to find a solution of the system of linear equations you don't have to call dgetri, use dgetrf/dgetrs or just dgesvinstead. Theerrorbound of the soltuion found by usingdgetrf/dgetrs depends onthe condition number and the problem size - put the typical numbers into the formula shown in the dgetrs description section of MKL manual andestimate theaccuracy - you'll see whether it's satisfactory for you or not.

You can improve the accuracy by using iterative refinement via dgesvx - it'll cost you a little overhead over dgetrf/dgetrs speed. If the accuracy is still not what you want, extra-precise iterative refinement functionality is coming with a later MKL release as part of LAPACK 3.2.

Michael.
0 Kudos
ArturGuzik
Valued Contributor I
831 Views
Depends on the "source" of your matrices you can take several approaches. The (quick) standard algorithms will handle well-conditioned matrices, and usually give a (widely) wrong answer for ill-conditioned one (you'll get non-zero small pivots). For general case I'd point you to SVD algorithm(s). They are implemented in MKL (see MKL docs). Then, if you deal with some sort of inverse problem you can also handle additional equations (rectangular matrices). As far as I can remember, the nice description you can find in Numerical Recipes. If this doesn't help, you need some regularization techniques.

A.
0 Kudos
ncroc
Beginner
831 Views
Hi,
if you need to solve a system with different right handsides, Ax=b1, Ax=b2, Ax=b3, ...,Ax=bk, you can factor A once via SVD,keep its low rank approximationandsolvek times for different right handsides.
Hope thats what you are looking for

Quoting - ArturGuzik
Depends on the "source" of your matrices you can take several approaches. The (quick) standard algorithms will handle well-conditioned matrices, and usually give a (widely) wrong answer for ill-conditioned one (you'll get non-zero small pivots). For general case I'd point you to SVD algorithm(s). They are implemented in MKL (see MKL docs). Then, if you deal with some sort of inverse problem you can also handle additional equations (rectangular matrices). As far as I can remember, the nice description you can find in Numerical Recipes. If this doesn't help, you need some regularization techniques.

A.

0 Kudos
Reply