inverse of a matrix for nxm

Discussion in 'C Programming' started by vishnu mahendra, Oct 17, 2003.

  1. 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.
     
    vishnu mahendra, Oct 17, 2003
    #1
    1. Advertising

  2. vishnu mahendra <> 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.
     
    Christopher Benson-Manica, Oct 17, 2003
    #2
    1. Advertising

  3. "vishnu mahendra" <> wrote in message
    news:...
    > 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
     
    Glen Herrmannsfeldt, Oct 17, 2003
    #3
  4. Greetings.

    In article <>, 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
     
    Tristan Miller, Oct 17, 2003
    #4
  5. In article <>,
    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.


    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
    Perhaps you should reflect on the fact that books are seldom sold by the
    kilogram.
    --Kevin Easton in comp.lang.c
     
    Dave Vandervies, Oct 17, 2003
    #5
  6. Off Topic: inverse of a matrix for nxm

    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/
     
    E. Robert Tisdale, Oct 17, 2003
    #6
  7. vishnu mahendra

    Eric Sosman Guest

    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.

    --
     
    Eric Sosman, Oct 17, 2003
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lvcargnini

    Matrix composed by two matrix

    lvcargnini, Jul 4, 2006, in forum: VHDL
    Replies:
    3
    Views:
    2,720
    Jonathan Bromley
    Jul 5, 2006
  2. DarrenWeber
    Replies:
    0
    Views:
    406
    DarrenWeber
    Jun 14, 2007
  3. Holgerson

    Matrix*Vector and Vector*Matrix

    Holgerson, Oct 25, 2007, in forum: C++
    Replies:
    3
    Views:
    436
    Holgerson
    Oct 26, 2007
  4. Daniel Fetchinson

    inverse of a matrix with Fraction entries

    Daniel Fetchinson, Nov 24, 2010, in forum: Python
    Replies:
    23
    Views:
    2,307
    Steven D'Aprano
    Nov 28, 2010
  5. rbovet

    Trouble with Matrix::inverse

    rbovet, Oct 28, 2003, in forum: Ruby
    Replies:
    2
    Views:
    120
    rbovet
    Oct 31, 2003
Loading...

Share This Page