testSphere2 fails on 32 bit Linux

Issue #96 resolved
Chris Beall created an issue
34/171 Test  #34: testSphere2 ............................***Failed    0.13 sec
not equal:
expected = [
        -nan,            0.0,             -1,   
        -nan,              1,            0.0,   
];
actual = [
         0.0,            0.0,             -1,   
         0.0,              1,            0.0,   
];
actual - expected = [
        -nan,            0.0,   -7.49456053e-12,    
        -nan,   8.33333402e-12,          0.0,   
];
/home/chris/git/gtsam/gtsam/geometry/tests/testSphere2.cpp:73: Failure: "assert_equal(expectedH, actualH, 1e-9)" 
There were 1 failures

Comments (8)

  1. Chris Beall reporter

    Expected in this test is a numerical derivative:

    expectedH = numericalDerivative21(rotate_, R, p);
    R.rotate(p, actualH, boost::none);
    EXPECT(assert_equal(expectedH, actualH, 1e-9));
    
  2. Chris Beall reporter

    Fixed in commit e1c0ad8. For the record, adding the following line to your code will cause floating point exceptions such as NaN to throw.

    feenableexcept(FE_INVALID | FE_OVERFLOW);
    
  3. Chris Beall reporter

    I'm not sure this is something that should be added in general, but I found it useful for debugging this issue in GDB. It's not portable, and might even affect performance, but not sure about the latter.

  4. Log in to comment