In article <c2*************************@posting.google.com> ,

vishnu mahendra <vi*************@yahoo.com> wrote:

hello to all,

can any one please give me an algorithm to find inverse of a matrix of order

n rows and m columns.

Algorithm to find inverse of a matrix using a computer program:

1. [decide how to solve problem] Decide whether you want to implement

a matrix inversion yourself or use one somebody else wrote.

2. If decision made in step 1 is writing one yourself, go to step 9.

3. [use somebody else's matrix inversion] Find a good search tool to

find libraries with. Google is a good first approximation.

4. [get somebody else's matrix inversion] Find a library that looks like

it will do what you need. Obtain and install the library and its

documentation.

ObTopic: Many libraries are implemented as functions callable from C.

5. Read the documentation to determine whether the library will do what

you need done, to verify the assumption in made in step 4.

6. [try again if necessary] If the library will NOT do what you need done,

go to step 1.

7. [find inverse using library] Write a program that will give the matrix

you want inverted to the library and get the inverse back out.

8. [done using library] Proceed to step 14.

9. [implement your own matrix inversion] Determine how to invert a matrix.

Consulting a linear algebra textbook may be helpful.

10. [write code] Write code that performs the necessary operations to

do this inversion.

ObTopic: C is one of the languages you may wish to consider using.

11. [verify and debug code] Test the code you wrote to make sure that

it correctly inverts any invertible matrix. If it doesn't, fix it

so that it does.

ObTopic: If you are having trouble with C code, posting the code

you're having trouble with here may be helpful, especially if you ask

well-thought-out questions that aren't answered in the FAQ and weren't

answered for somebody else yesterday.

12. [decide whether to give up and try again] If while performing step 11

you decide that writing your own code wasn't worth the effort after

all, interrupt step 11 and go to step 1.

13. [find inverse using your code] Write a program that will give the

matrix you want inverted to the code you wrote and debugged in steps

10 and 11 and get the inverse back out.

14. [done] You have now inverted your matrix. Wasn't that easy?

dave

--

Dave Vandervies

dj******@csclub.uwaterloo.ca
Perhaps you should reflect on the fact that books are seldom sold by the

kilogram.

--Kevin Easton in comp.lang.c