[eigen] Problem inverting a Matrix4f with Eigen 2.0.0 |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
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.
Matrix4f:
fisher
1.353e-05 0.07932 0.09445 -0.01072
0.07932 1394 557.7 -188.4
0.09445 557.7 1977 -224.4
-0.01072 -188.4 -224.4 2231
determinant = 3.63e+04
fisher^-1 (i.e. fisher.inverse()):
0 7.761e+06 1.239e-29 2.868e-42
0 4.355 4.248 0
1.261e-44 0 0 4.356
0 0 0 0
1.53e-41 1.401e-44 8.408e-44
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
whereas in double precision:
Matrix4d:
fisher
1.353e-05 0.07932 0.09445 -0.01072
0.07932 1394 557.7 -188.4
0.09445 557.7 1977 -224.4
-0.01072 -188.4 -224.4 2231
determinant = 3.63e+04
fisher^-1
1.478e+05 -6.328 -5.314 -0.359
-6.328 0.001084 3.49e-06 6.15e-05
-5.314 3.49e-06 0.0007645 5.165e-05
-0.359 6.15e-05 5.165e-05 0.0004569
0.001084 0.0007645 0.0004569
This is using g++ 4.3.2 on a linux box.
R