Re: [eigen] Problem inverting a Matrix4f with Eigen 2.0.0 |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Robert Lupton the Good wrote:
I'm using Eigen 2.0.0 to invert some small (4x4) matrices --- I need
the covariance matrix, so there's no need to tell me to
solve-not-invert!
Anyway, with floats, we fail to invert although the determinant is
decent, ~ 3.6e4. Is there a better way to check for a failed
inversion? I didn't see anything in the manual.
determinant != condition:
http://en.wikipedia.org/wiki/Condition_number
Matlab says the condition of your matrix is 3.8e8, which is pretty bad.
(btw: is there a way to calculate condition with Eigen?)
I think invert() uses LU-Decomposition. Have you tried using slightly
more stable Cholesky instead? I guess something like this could work:
Matrix4f inverse;
inverse.setIdentity();
fisher.ldlt().solveInPlace(inverse);
hth, Christoph
--
----------------------------------------------
Dipl.-Inf. Christoph Hertzberg
Cartesium 0.051
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen
Tel: (+49) 421-218-64252
----------------------------------------------