35 using namespace gtsam;
40 using namespace serializationTestHelpers;
56 "gtsam_HybridGaussianFactor_Factors");
58 "gtsam_HybridGaussianFactor_Factors_Leaf");
60 "gtsam_HybridGaussianFactor_Factors_Choice");
63 "gtsam_GaussianFactorGraphValuePair");
65 "gtsam_HybridGaussianProductFactor");
68 "gtsam_HybridGaussianConditional");
70 "gtsam_HybridGaussianConditional_Conditionals");
72 "gtsam_HybridGaussianConditional_Conditionals_Leaf");
74 "gtsam_HybridGaussianConditional_Conditionals_Choice");
85 auto A = Matrix::Zero(2, 1);
86 auto b0 = Matrix::Zero(2, 1);
87 auto b1 = Matrix::Ones(2, 1);
88 auto f0 = std::make_shared<JacobianFactor>(
X(0),
A, b0);
89 auto f1 = std::make_shared<JacobianFactor>(
X(0),
A,
b1);
90 std::vector<GaussianFactor::shared_ptr>
factors{
f0,
f1};
94 EXPECT(equalsObj<HybridGaussianFactor>(factor));
95 EXPECT(equalsXML<HybridGaussianFactor>(factor));
96 EXPECT(equalsBinary<HybridGaussianFactor>(factor));
104 const auto conditional = std::make_shared<GaussianConditional>(
105 GaussianConditional::FromMeanAndStddev(
Z(0),
I,
X(0),
Vector1(0), 0.5));
108 EXPECT(equalsObj<HybridConditional>(
hc));
109 EXPECT(equalsXML<HybridConditional>(
hc));
110 EXPECT(equalsBinary<HybridConditional>(
hc));
118 const auto conditional0 = std::make_shared<GaussianConditional>(
119 GaussianConditional::FromMeanAndStddev(
Z(0),
I,
X(0),
Vector1(0), 0.5));
120 const auto conditional1 = std::make_shared<GaussianConditional>(
121 GaussianConditional::FromMeanAndStddev(
Z(0),
I,
X(0),
Vector1(0), 3));
124 EXPECT(equalsObj<HybridGaussianConditional>(gm));
125 EXPECT(equalsXML<HybridGaussianConditional>(gm));
126 EXPECT(equalsBinary<HybridGaussianConditional>(gm));
133 HybridBayesNet hbn = *(
s.linearizedFactorGraph().eliminateSequential());
135 EXPECT(equalsObj<HybridBayesNet>(hbn));
136 EXPECT(equalsXML<HybridBayesNet>(hbn));
137 EXPECT(equalsBinary<HybridBayesNet>(hbn));
146 EXPECT(equalsObj<HybridBayesTree>(hbt));
147 EXPECT(equalsXML<HybridBayesTree>(hbt));
148 EXPECT(equalsBinary<HybridBayesTree>(hbt));