Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

General matrix inversion routine

anthonyrichards
Neuer Beitragender III
952Aufrufe
I want a routine that will just invert a matrix. I find the CXML documentation as clear as mud on this. It mentions routines for solving a system of equations, but it does not say if a routine returns an inverse. Can any one please help?
0 Kudos
3 Antworten
Intel_C_Intel
Mitarbeiter
952Aufrufe

Well, with all the usual warnings....

Here's a piece of code I've been using for quite some time.

Usage is simple;

Call QRinv( A, Ai )

where A is the matrix you want inverted and Ai is the output inverse. Remember to allocate Ai before calling if it is dynamic.

Feel free to askif the code comments aren't sufficient.

Cheers, Cliff

ArturGuzik
Geschätzter Beitragender I
952Aufrufe

Anthony,

it really depends on what type of matrix you're going to invert. If it is well-conditioned try IMSL (or equivalent) LU decomposition like DLINRG (allows you to re-use the space of original matrix what can be nice if the size is a problem and you don't need the original), or generalized version DLSGRR. The latter is suited for ill-conditioned problems as it first decomposes matrix using SVD so you can handle problem of matrix singularity. Naturally, it makes it slower. If you don't have IMSL youshould find that sort of routines at Netlib. Definitely you'll find it in Numerical Recipes. I remember Jugoslav once pointed to some source code for generalized inverse, so try to search this forum on this as well.

A.

anthonyrichards
Neuer Beitragender III
952Aufrufe
Many thanbks for your helpful replies.
Antworten