Link to home
Start Free TrialLog in
Avatar of eeeyliao
eeeyliao

asked on

Matrix inversion [6x6]


Anyone knows how to do a 6x6 matrix inversion?
Avatar of Slarti
Slarti

eeeyliao,
Try using the following software package, which will do it for you:
http://www.simtel.net/pub/simtelnet/msdos/cpluspls/drmatrix.zip
The package allows you to perform various matrix operations, including multiplication, inversion, etc.

If you don't like his answer, let me know.  I have source code that I wrote several years ago in pascal for a linear algebra class - it should be easy to convert to C
Avatar of eeeyliao

ASKER

I know some packages such as Matlab etc, but i need the algorithm
and the source code.
Can I have your source code in Pascal pleases?
Adjust your points to 200 and I'll send you the source in Pascal.
Adjust your points to 200 and I'll send you the source in Pascal.
ASKER CERTIFIED SOLUTION
Avatar of navigator010897
navigator010897

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I need to inverse a 6x6 matrix!

Can you send me your programs in Fortran please?
The inversion functions will invert matrices of ANY size -so I sent them to you.  I sent the determinant function more as a courtesy as you didn't ask for that, you just asked for inversion - and procedure Inverse does not use the determinant in doing the inversion, so you should be able to use that.  The fortran function I converted was the Inverse function (not inverse2 and det and eliminate) - and I don't own the fortran book that I had used as reference.  At the time, I was in school and borrowed the fortran book from a teacher so I could do the conversion.

Frankly, the fortran function looks almost identical to my converted function - it is not *limited* to a 6x6. All you need to do is:

1) Create a struct following the record pattern I showed at the top.

2) Declare 2 variables to be of that record structure

3) Fill in one of the two variables you declared with a 6x6 matrix.

4) Convert the pascal Inverse Function (or the pascal Inverse2, and use the det and elimination functions as starter points in creating your own determination and elimination functions) - assuming you just did the Inverse function, it might look like:
void Inverse(struct MATRIX M, struct MATRIX *Result)

5) Call the inverse function with your input matrix, and the second declared matrix for the result - something like:
Inverse(InMat, &OutMat)

And that's it.  I just said my det/elim functions wouldn't handle a 6x6.
Thank you for your help!
Thank you for your help!