PDA

View Full Version : math question - linear algebra



Captain Penguin
10-04-2002, 01:50 PM
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

Captain Penguin
10-04-2002, 10:05 PM
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?

xds4lx
10-05-2002, 12:12 AM
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.

Nick
10-05-2002, 09:29 AM
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/

Captain Penguin
10-05-2002, 09:49 AM
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.

Nick
10-05-2002, 02:52 PM
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/teaching/units/ma273/node11.html