Expanded shortcut_overlapping_separator test in testGaussianBayesTreeB to allow for sign reversal in a row of the augmented Jacobian. The joint density does not appear to be affected in the case where the augmented Jacobian row sign is changed, so we should not fail the test if that happens.

release/4.3a0
Mike Sheffler 2018-09-27 18:19:44 -07:00
parent 1a1cfdd0ad
commit bd4ab1598e
1 changed files with 17 additions and 0 deletions

View File

@ -317,8 +317,25 @@ TEST(GaussianBayesTree, shortcut_overlapping_separator)
5, 0, 6,
0, -11, -12
).finished();
Matrix actualJointJ = joint.augmentedJacobian();
bool Row0RhsSignsEqual =
signbit(expectedJointJ(0, 2)) == signbit(actualJointJ(0, 2));
if (!Row0RhsSignsEqual)
{
expectedJointJ.row(0) = -expectedJointJ.row(0);
}
bool Row1RhsSignsEqual =
signbit(expectedJointJ(1, 2)) == signbit(actualJointJ(1, 2));
if (!Row1RhsSignsEqual)
{
expectedJointJ.row(1) = -expectedJointJ.row(1);
}
EXPECT(assert_equal(expectedJointJ, actualJointJ));
}