Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sum and inversion of matrix

Status
Not open for further replies.

smile23

Programmer
Oct 17, 2010
3
IT
hello!
is there a intrinsic function for the sum of arrays?..and for the inversion of a matrix?
thanks
 
For the sum : simply +

For the inversion, you need a dedicated library like LAPACK which provides many methods depending on your matrix.
 
You could use sum to sum the elements of a matrix/array.

Question: why do you need the inverse? Is it to solve simultaneous equations? If it is, it would be faster to use Choleski LU decomposition than matrix inversion.
 
I agree with xwb that LU is faster. There are many many methods to do this job, upto Gauss-Seidel.

A good explanation with fortran 77 codes included can be found at the numerical recipes page.


Reading chapter 2, you can judge for yourself about the best method and code it (the given codes are short and handy and don't need any library, I used to translate that given codes to F90 when needed).

P.S.: As far as I remember, Cholesky is a restrictive form of LU for symmetric matrices only
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top