Re: [eigen] request for help: 4x4 matrix inverse |
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
Hm, just one remark: On Monday 14 April 2008 19:50:47 Konstantinos Margaritis wrote: > We partition the matrix in 4 2x2 matrices: > > M= | P Q | > > | R S | > > where P = | a1 a2 |, Q = | a3 a4 |, R = | c1 c2 |, S = | c3 c4 | > > | b1 b2 | | b3 b4 | | d1 d2 | | d3 d4 | > > (actually the method is generic for any NxM matrix, but it becomes > quite more complicated in these cases). > So, M's determinant is calculated thus: > > detM = detP * det(S - R*P1*Q) > > ( P1 = P^(-1) ) > > (so if detP = 0, detM = 0 and M has no inverse, but detP is calculated > in just one step!) I don't agree with the last sentence: it is easy to find examples where detP=0 and detM is nonzero. For example, M= (1 1 0 0) (1 1 1 0) (0 1 1 0) (0 0 0 1) this matrix M is invertible, but its topleft 2x2 block is not. I think that your formula works when P is invertible, but doesn't allow to conclude anything when P is not. But that's not a problem for me since what I really need is the 4x4 inversion and for this I think that your method will work great -- implementing it right now. For 4x4 determinant, I think that the method I have in LU/Determinant.h is even faster since it does only 30 muls and zero divs -- and so in particular, zero conditional branching. Cheers, Benoit
Attachment:
signature.asc
Description: This is a digitally signed message part.
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |