fix skew symmetric test

Reference issue

What does this implement/fix?

Since we changed the random number generation facilities in Eigen, we've been getting failures in the skew-symmetric test.

2/2 Test #206: skew_symmetric_matrix3_2 .........Child aborted***Exception:   0.19 sec
Initializing random number generator with seed 1707029388
Repeating each test 10 times
Difference too large wrt tolerance 0.001, relative error is: 2.33333
Test skewSymmetricMultiplication(MatrixXf(3, internal::random<int>(1, 320))) failed in ../test/skew_symmetric_matrix3.cpp (120)
    verifyIsApprox(m1.transpose() * (sk * m1), (m1.transpose() * sk) * m1)

This test randomly fails on several versions of clang, with various vectorization options. I think this has nothing to do with the compiler or the architecture -- the test fails when we get unlucky with the random size. I can reproduce the failure on MSVC.

The diagonal of the product m^T * S * m where m is a 3 x k matrix and S is a 3 x 3 skew-symmetric matrix is zero. This is problematic when k == 1 (the product is a scalar) and we are testing for equality, as catastrophic cancellation renders the comparison tricky.

We can "fix" the test by not testing for the not-so-trivial case where k == 1.

Additional information

Edited by Charles Schlosser

Merge request reports

Loading