How to find inverse of a sparse matrix?


smp
06-24-2010, 06:45 AM
Hi,

I have a matrix of dimensions 100 x 100.
It is a sparse matrix.
It has 460 non-zero values (9540 are zero values).

I want to find inverse of this matrix.

I used ludcmp( ) and lubksb( ) to invert the matrix. I used them for a simple 3x3 matrix. I got the inverse. Then I mulitiplied that inverse with the original matrix. As expected I got the identity matrix.
Now the same thing I tried for my 100x100 sparse matrix. I got the inverse. So to check, I multiplied this inverse by original matrix. But I did not get Identity matrix.

Any help will be highly appreciated.
This is urgent.

Regards,
smp

jaje
08-29-2010, 03:13 AM
Are you sure you want an inverse? it's going to be very dense!

Having said that, did you make sure the matrix you fed to the NR routines is consistent with the indexing used by the routines? It seems to be a very common slip-up.

Jan M.