[eigen] inverse unit test

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

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

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:

- Hauke

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