Hi all
The documentation for the inverse_matrix() function states that it uses LU factorisation to invert, but also states that for most solutions the function solve_linsys() is more efficient, but it also uses LU factorisation.
Theoretically, that means that for an invertible matrix A,
> Ainv = inverse_matrix(A)
is the same as
> I = conform(A, 0, -1) ;create identity matrix 'I'
> do i = 0, nrow-1
> I(i,i) = 1
> end do
> Ainv = solve_linsys(A, I)
Mathematically they're the same, but is there any way in which the functions are coded that would make one more efficient than the other? Or is the 'inverse_matrix()' function just doing what I did in the second case?
I'm dealing with large covariance matrices for a lot of model control runs, so even a modest difference in efficiency would be interesting to know.
Many thanks
Will
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Apr 25 18:56:25 2013
This archive was generated by hypermail 2.1.8 : Fri Apr 26 2013 - 17:10:25 MDT