By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 2,107 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

inverse of a matrix for nxm

P: n/a
hello to all,

can any one please give me an algorithm to find inverse of a matrix of order
n rows and m columns.

thank you in advance,
vishnu.
Nov 13 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
vishnu mahendra <vi*************@yahoo.com> spoke thus:
can any one please give me an algorithm to find inverse of a matrix of order
n rows and m columns.


www.google.com

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Nov 13 '05 #2

P: n/a

"vishnu mahendra" <vi*************@yahoo.com> wrote in message
news:c2*************************@posting.google.co m...
hello to all,

can any one please give me an algorithm to find inverse of a matrix of order n rows and m columns.


No. You might look up SVD somewhere, and see if that helps.

Not in this newsgroup, though.

-- glen
Nov 13 '05 #3

P: n/a
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
Nov 13 '05 #4

P: n/a
Greetings.

In article <c2*************************@posting.google.com> , vishnu mahendra
can any one please give me an algorithm to find inverse of a matrix of
order n rows and m columns.


This isn't an algorithms group. You could try comp.graphics.algorithms,
comp.sources,wanted, or sci.math.num-analysis, or perhaps a web search.

--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
Nov 13 '05 #5

P: n/a
vishnu mahendra wrote:
Can any one please give me an algorithm
to find inverse of a matrix of order n rows and m columns.


A rectangular matrix does *not* have an inverse unless m = n.
You might be interested in the Moore-Penrose pseudo inverse.
I used Google

http://www.google.com/

to search for

"Moore-Penrose pseudo inverse"

and found lots of stuff.
You would probably be more interested in
a Singular Value Decomposition (SVD) to help solve your problem.
Take a look at GSL -- The GNU Scientific Library

http://sources.redhat.com/gsl/

Nov 13 '05 #6

P: n/a
vishnu mahendra 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.
The problem is unsolvable in the general case.

If both `m' and `n' are integral and greater than zero and
if their exclusive-or is zero, there may be a solution. Here's
some pseudocode:

if (m <= 0 || m > n || m < n || 0 == ((m ^ n) == '\0'))
fail();
else {
while (1) {
generate a random m-by-n matrix;
multiply it by the given matrix;
if (product matrix has ones on the main
diagonal and zeroes everywhere else)
break;
}
/* the randomly-generated matrix is the
inverse of the given matrix */
succeed();
}

Be sure not to use this code on a singular matrix!
thank you in advance,


You're welcome in retreat.

--
Er*********@sun.com
Nov 13 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.