[eigen] inverse unit test
• To: Eigen <eigen@xxxxxxxxxxxxxxxxxxx>
• Subject: [eigen] inverse unit test
• From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
• Date: Thu, 10 Jun 2010 00:43:43 +0200
• Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=AzQ6wl5heloMFePZxBgaQein3HfroPMzlJItaNn14gS2hJp350uMI1zz20k8td/hHa M6WEYrKrFWO29WWLb7i1WSJMZhITlFAfAPZzveSSnLdsdq3VpUxx/2BzVAsJSjBI4DM7 OQTv9N3WV2D3DNxu91nWhx/Lr5RxgVWrcEgVM=

```On MSVC the inverse unit test fails here:

//Second: a rank one matrix (not invertible, except for 1x1 matrices)
VectorType v3 = VectorType::Random(rows);
MatrixType m3 = v3*v3.transpose(), m4(rows,cols);
m3.computeInverseAndDetWithCheck(m4, det, invertible);
VERIFY( rows==1 ? invertible : !invertible );
VERIFY_IS_APPROX(det, m3.determinant());
m3.computeInverseWithCheck(m4, invertible);
VERIFY( rows==1 ? invertible : !invertible );

We expect a determinant of 0 since the matrix is not invertible and
then this check fails

VERIFY_IS_APPROX(det, m3.determinant());

VERIFY_IS_APPROX will always fail in case one of the two parameters is
zero and in case both values are small it is likely to fail as well
because

abs(x-y) <= min(abs(x),abs(y)) * 1e-3

here, we take the minimal value and make it even smaller.

Here are some nice comparison methods we might try to adapt:
http://www.boost.org/doc/libs/1_32_0/boost/test/floating_point_comparison.hpp

- Hauke

```

 Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/