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

Cannot invert a matrix with IMSL routine LINDS

Pratap__Sangeeta
Beginner
1,935 Views

I am trying to use a standard IMSL routine LINDS to invert a positive definite matrix,. 

I installed the IMSL library based on these instructions. 

https://software.intel.com/en-us/articles/installing-and-using-the-imsl-libraries

 

Then I included the lines 

INCLUDE 'link_fnl_shared.h'

use linds_int

in my program, before setting up the matrix to be inverted

The program compiles without error, but when I debug it it, it exits without inverting the matrix. It  does not trigger a break  point, but it just stops. 

Any help will be greatly appreciated. Thank you very much

 

0 Kudos
22 Replies
mecej4
Honored Contributor III
223 Views

I have this comment regarding the first part of the program code in #20.

You compute X = ATA for a matrix A of size 338 X 3 and then find the inverse of X. For the particular matrix that you chose, i.e., aij = floor(i/j), the condition number of A is  about 930, and the condition number of X is the square of that, i.e., about 9 X 105. If you calculate X in single precision, that means that only one or two significant digits may be correct.

Two further points to note: in general, it is bad to form the normal matrix X and then work with it. If your ultimate objective is to solve overdetermined linear equations A.x = b, for example, rather than forming X, use the well-known QR decomposition of A. Likewise, it is bad practice to form the inverse matrix explictly if your objective is to solve linear equations. When I say "bad", I mean (i) inefficient and (ii) inaccurate. Any book on numerical analysis and Wikipedia articles can provide you with details on why the "bad" happens.

0 Kudos
JohnNichols
Valued Contributor III
221 Views

Let us stop this string of notes - it is gettting quite long, there are innumerable books, and the solution is well known.

 

0 Kudos
Reply