Académique Documents
Professionnel Documents
Culture Documents
I wrote the above function with some help from the web. But the values all come out
wrong...Off course I don't understand the logic of the main line of calculation.
What do I do now?
Jun 27, 2010 at 12:34am
jsmith (5804)
If you don't understand the mathematics of the calculation then you can't debug it because
you don't know how it is supposed to work.
First go figure out how to compute cofactors, then figure out why the above line doesn't
do it right.
Jun 27, 2010 at 12:53am
m4ster r0shi (2197)
Your calculation is correct. Your function works fine for me.
Just fix this -> cofactor_v[x][y]=//... . It should be like this -> cofactor_v=//...
http://en.wikipedia.org/wiki/Cofactor_%28linear_algebra%29
Last edited on Jun 27, 2010 at 12:54am
Jun 27, 2010 at 3:48am
manasij7479 (113)
I know what a cofactor is. But the logic of this function is not clear to me.
From what I know, Cofactor A(ij)= (-1)^(i+j) * M(ij) where M is the respective minor.
Mmm... So, there's one more thing to be fixed... To sum up, the formula should be like this: