unit test exposing division bug

release/4.3a0
Varun Agrawal 2025-01-03 13:28:21 -05:00
parent e6567457b5
commit cb9cec30e3
1 changed files with 9 additions and 0 deletions

View File

@ -69,6 +69,15 @@ TEST(DecisionTreeFactor, constructors) {
EXPECT_DOUBLES_EQUAL(0.8, f4(x121), 1e-9);
}
/* ************************************************************************* */
TEST(DecisionTreeFactor, Divide) {
DiscreteKey A(0, 2), S(1, 2);
DecisionTreeFactor pA(A % "99/1"), pS(S % "50/50");
DecisionTreeFactor joint = pA * pS;
DecisionTreeFactor s = joint / pA;
EXPECT(assert_equal(pS, s));
}
/* ************************************************************************* */
TEST(DecisionTreeFactor, Error) {
// Declare a bunch of keys