Inverting large matrices using LA_LUDC and LA_LUSOL. [message #46803] |
Wed, 04 January 2006 16:15 |
Pitufa
Messages: 8 Registered: July 2005
|
Junior Member |
|
|
Hi,
I was wondering if someone had a tip for my following problem:
I am trying to calculate a matrix of the form:
W = M^(-1)##A
where M = A##B, and:
size(A) =
2 3840 1942 9 7457280
size(B) =
2 1942 3840 9 7457280
I do this (or rather try) by using:
M = MATRIX_MULTIPLY(B,A)
LA_LUDC, M, Index , /DOUBLE, STATUS=STATUS
if status ne 0 then stop, 'Status ne 0.'
W = LA_LUSOL( M, Index, A , /DOUBLE )
But W##B is not equal to the identity matrix (the maximum difference
with the identity matrix is 6788.3314 !!), and the status returned is
0.
However, if I do the following:
M = MATRIX_MULTIPLY(B,A)
M2 = M
LA_LUDC, M, Index , /DOUBLE, STATUS=STATUS
if status ne 0 then stop, 'Status ne 0.'
W = LA_LUSOL( M, Index, M2 , /DOUBLE )
then the maximum difference with the identity matrix is 0.27161849
(even if the first case gave me this, I still have a problem).
IDL uses LAPACK routines to do the above operation, and apparently this
is the best option for this kind of operations.
Does anyone know what I might be doing wrong?
Thanks you for your time,
Carolina.
|
|
|