Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29611 ディスカッション

General matrix inversion routine

anthonyrichards
新規コントリビューター III
1,679件の閲覧回数
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 件の賞賛
3 返答(返信)
Intel_C_Intel
従業員
1,679件の閲覧回数

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
高評価コントリビューター I
1,679件の閲覧回数

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
新規コントリビューター III
1,679件の閲覧回数
Many thanbks for your helpful replies.
返信