Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

General matrix inversion routine

anthonyrichards
New Contributor III
732 Views
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 Replies
Intel_C_Intel
Employee
732 Views

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

0 Kudos
ArturGuzik
Valued Contributor I
732 Views

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.

0 Kudos
anthonyrichards
New Contributor III
732 Views
Many thanbks for your helpful replies.
0 Kudos
Reply