How do I write the code to calculate the inverse of an NxN matrix? Thank you in advance.
Printable View
How do I write the code to calculate the inverse of an NxN matrix? Thank you in advance.
I think the best you can do is download chapter 2 of "Numerical Recipes". The complete book is free on-line and the algorithms are available in a number of versions such as C, Fortran... Converting from one of these to VB shouldn't be too difficult. From the home page
http://www.nr.com
you can then, for example, jump to
http://www.library.cornell.edu/nr/bookcpdf.html
My favourite method is the LU decomposition and it appears that handheld calculators by HP use that too for matrix operations.
Try searching this forum. I think some VB code and a description of the algorithm was posted.
Possible search keys are: inverse, gauss, matrix.