26 using namespace gtsam;
44 Tree tree({{
"A", 2}}, std::vector<int>{1, 2});
46 using namespace serializationTestHelpers;
49 Tree outputObj = create<Tree>();
50 roundtrip<Tree>(tree, outputObj);
51 EXPECT(tree.equals(outputObj));
54 Tree outputXml = create<Tree>();
55 roundtripXML<Tree>(tree, outputXml);
56 EXPECT(tree.equals(outputXml));
59 Tree outputBinary = create<Tree>();
60 roundtripBinary<Tree>(tree, outputBinary);
61 EXPECT(tree.equals(outputBinary));
67 using namespace serializationTestHelpers;
72 EXPECT(equalsObj<DecisionTreeFactor::ADT>(tree));
73 EXPECT(equalsXML<DecisionTreeFactor::ADT>(tree));
74 EXPECT(equalsBinary<DecisionTreeFactor::ADT>(tree));
77 EXPECT(equalsObj<DecisionTreeFactor>(f));
78 EXPECT(equalsXML<DecisionTreeFactor>(f));
79 EXPECT(equalsBinary<DecisionTreeFactor>(f));
85 using namespace serializationTestHelpers;
90 EXPECT(equalsObj<DiscreteConditional>(conditional));
91 EXPECT(equalsXML<DiscreteConditional>(conditional));
92 EXPECT(equalsBinary<DiscreteConditional>(conditional));
95 EXPECT(equalsObj<DiscreteDistribution>(P));
96 EXPECT(equalsXML<DiscreteDistribution>(P));
97 EXPECT(equalsBinary<DiscreteDistribution>(P));
static int runAllTests(TestResult &result)
TEST(DiscreteSerialization, DecisionTree)
#define EXPECT(condition)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
static sharedNode Leaf(Key key, const SymbolicFactorGraph &factors)
Matrix< Scalar, Dynamic, Dynamic > C
std::pair< Key, size_t > DiscreteKey
BOOST_CLASS_EXPORT_GUID(DecisionTreeFactor, "gtsam_DecisionTreeFactor")
std::uint64_t Key
Integer nonlinear key type.