I've painstakingly debugged my code that brings a matrix into reduced echelon form, to calculate the inverse. The prospect of writing the recursive function for the determinant is not inviting. Isn't there some way of using the inverse to find the determinant?
Announcement
Collapse
No announcement yet.
is there a very easy to code way of calculating the determinant using the inverse?
Collapse
X
-
a) the determinant of the inverse is the inverse of the determinant
b) instead of using a recursive function to calculate the determinant by minors, use the the even/odd permutation definition of determinant
c) write down the eigenvalue equation for the matrix, solve for the roots and multiply them together to get the determinant12-17-10 Mohamed Bouazizi NEVER FORGET
Stadtluft Macht Frei
Killing it is the new killing it
Ultima Ratio Regum
-
The determinant is properly defined as:
the sum over all permutations sigma of (-1)^(sign of sigma) a1sigma(1)a2sigma(2)...ansigma(n)12-17-10 Mohamed Bouazizi NEVER FORGET
Stadtluft Macht Frei
Killing it is the new killing it
Ultima Ratio Regum
Comment
-
I've painstakingly debugged my code that brings a matrix into reduced echelon form, to calculate the inverse. The prospect of writing the recursive function for the determinant is not inviting. Isn't there some way of using the inverse to find the determinant?
Not unless its inverse is easy to calculate.
Easiest way would be this:
detA = eq1...qnA1q1...Anqn
Edit: In case it's not clear, the summation over each qm is implied through repeated indices. And eq1...qn gives 1 if q1..qn is an even permutation of 1...n, -1 if it's an odd permutation.Last edited by Ramo; March 6, 2005, 23:22."Beware of the man who works hard to learn something, learns it, and finds himself no wiser than before. He is full of murderous resentment of people who are ignorant without having come by their ignorance the hard way. "
-Bokonon
Comment
-
If you've written down the row-reduced echelon form of the matrix and this has non zero determinant (i.e. it's the unit matrix) then if you've kept track of the operations performed to get ther then the determinant is trivial to calculate...12-17-10 Mohamed Bouazizi NEVER FORGET
Stadtluft Macht Frei
Killing it is the new killing it
Ultima Ratio Regum
Comment
-
Originally posted by KrazyHorse
If you've written down the row-reduced echelon form of the matrix and this has non zero determinant (i.e. it's the unit matrix) then if you've kept track of the operations performed to get ther then the determinant is trivial to calculate...
Thanks! That's really, really easy to implement.
Comment
-
How big is this matrix?12-17-10 Mohamed Bouazizi NEVER FORGET
Stadtluft Macht Frei
Killing it is the new killing it
Ultima Ratio Regum
Comment
-
Won't it take forever to run anything larger than 20X20 or so?12-17-10 Mohamed Bouazizi NEVER FORGET
Stadtluft Macht Frei
Killing it is the new killing it
Ultima Ratio Regum
Comment
-
I think exact inversion runs in N^3 time. Can't remember.12-17-10 Mohamed Bouazizi NEVER FORGET
Stadtluft Macht Frei
Killing it is the new killing it
Ultima Ratio Regum
Comment
-
approximate numerical inversion is much faster.12-17-10 Mohamed Bouazizi NEVER FORGET
Stadtluft Macht Frei
Killing it is the new killing it
Ultima Ratio Regum
Comment
Comment