Thread: math question - linear algebra

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    244

    math question - linear algebra

    I'm writing functions for my matrix class that will find the inverse of a matrix and will put a system in row reduced echelon form.

    I have a pretty good idea of how I'll manage with forward elimination - create an elimination matrix, like so:

    |1 0 0|
    |-2 1 0|
    |0 0 1|

    and multiply it by the matrix, which would subtract twice the first row from the second row.

    BUT to do rref or to find an inverse, I must be able to do BACKWARDS elimination - I understand the concept perfectly on paper, but I would like to be able to put it in terms of an elimination matrix for my program. i.e, what elimination matrix would you need to change (1,2) in the following matrix into a 0:

    |2 2 0|
    |0 3 0|
    |0 0 5|

    Or is there no elimination matrix that does this (perhaps thats why our teacher didn't say what it was) and I must just write a function to do the actual multiplying of a row and subtracting it from another row?

    Thanks

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    244
    C'mon this is a programming board! someone has to know linear algebra! all of you should!

    Has no one replied because its not clear enough?

  3. #3
    Registered User xds4lx's Avatar
    Join Date
    Nov 2001
    Posts
    630
    I know linear algebra and I konw how to do this also, but its complicated and I dont want to type that much because I just had a horrible night and found my gf making out with some f**k so im really ........ed off, but I will say go to Intel's web page and look in their asm documentation they have some example code thats written in asm that should do everything you want to a matrix.

  4. #4
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    My linear algebra book says that most
    computer programs that do gaussian elimination do it
    forwards but not backwards. Instead of backwards
    elimination it says that most programs will just use
    subsitution. In doubt you can always check numerical
    recipies which is online http://www.nr.com/
    Last edited by Nick; 10-05-2002 at 09:37 AM.

  5. #5
    Registered User
    Join Date
    Aug 2001
    Posts
    244
    Originally posted by Nick
    My linear algebra book says that most
    computer programs that do gaussian elimination do it
    forwards but not backwards. Instead of backwards
    elimination it says that most programs will just use
    subsitution. In doubt you can always check numerical
    recipies which is online http://www.nr.com/
    Well I think its slightly different than backwards substitution.

    The goal is to get 0's above the diagonal by doing row addition and subtraction. For example:

    1 1 3 0 -3/4 1
    0 1 2 0 1/2 -2
    0 0 0 1 -3/4 1

    This is an augmented matrix with A and the b vector on the right. To solve it I'd have to get 0's above and below each pivot. So I'd have to make the 1 at position (1,2) into a 0 by subtracting the second row from the first. This is similar to Gaussian elimination, but for numbers above the diagonal instead of below. Maybe this IS backwards substitution and I just am having trouble recognizing it as such.

  6. #6
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    Oh my bad I didn't read the problem carefully.
    Subsitution is what you use when you want to find
    the solution set.
    Maybe this will help
    http://www.maths.soton.ac.uk/teachin...73/node11.html

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Math Type Question
    By Rune Hunter in forum C++ Programming
    Replies: 1
    Last Post: 11-09-2005, 07:35 PM
  2. Stupid Math Question....really stupid
    By ToLazytoSignIn in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 01-16-2003, 07:36 PM
  3. Very large signed integer math question
    By Criz in forum C Programming
    Replies: 8
    Last Post: 12-01-2002, 12:43 PM
  4. Very simple question, problem in my Code.
    By Vber in forum C Programming
    Replies: 7
    Last Post: 11-16-2002, 03:57 PM
  5. Math Question
    By DarkEldar77 in forum C++ Programming
    Replies: 2
    Last Post: 09-17-2001, 12:52 PM