How to find Matrix Inverse

Hello,

I am writing a program to make addition of two matrices and to find the inverse. I am using class and objects.
Is there any snippet of Gauss-Jordan OR Row Operation to use ?

Thanks!
hi fukki,

yeah there is.
i guess you are looking for the multiplicative inverse, because the inverse for addition would be pretty easy ^.^
to invert a matrix u have to combine your original matrix m with a simple unit matrix (just zeros with ones in the diagonal).
then use the gauss algorithm.
the right side of the new matrix is the inverse of m.

example:

your matrix m=
(2,3
1,2)
the unit matrix=
(1,0
0,1)
combine the matrices:
(2,3,1,0
1,2,0,1)
use gauss algorithm:
(1,0,2,-3
0,1,-1,2)
use the right side:
(2.-3
-1,2)
this is the inverse matrix ;)

lg,
flowly
Thanks flowly, i think now is very easier to write the algorithm!
Topic archived. No new replies allowed.