Skip to content

Commit

Permalink
test if serialization is the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal committed Oct 9, 2024
1 parent a1a8ee2 commit 8d03e71
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions gtsam/hybrid/tests/testSerializationHybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,43 +105,43 @@ TEST(HybridSerialization, HybridConditional) {
EXPECT(equalsBinary<HybridConditional>(hc));
}

/* ****************************************************************************/
// Test HybridGaussianConditional serialization.
TEST(HybridSerialization, HybridGaussianConditional) {
const DiscreteKey mode(M(0), 2);
Matrix1 I = Matrix1::Identity();
const auto conditional0 = std::make_shared<GaussianConditional>(
GaussianConditional::FromMeanAndStddev(Z(0), I, X(0), Vector1(0), 0.5));
const auto conditional1 = std::make_shared<GaussianConditional>(
GaussianConditional::FromMeanAndStddev(Z(0), I, X(0), Vector1(0), 3));
const HybridGaussianConditional gm(mode, {conditional0, conditional1});

EXPECT(equalsObj<HybridGaussianConditional>(gm));
EXPECT(equalsXML<HybridGaussianConditional>(gm));
EXPECT(equalsBinary<HybridGaussianConditional>(gm));
}

/* ****************************************************************************/
// Test HybridBayesNet serialization.
TEST(HybridSerialization, HybridBayesNet) {
Switching s(2);
HybridBayesNet hbn = *(s.linearizedFactorGraph.eliminateSequential());

EXPECT(equalsObj<HybridBayesNet>(hbn));
EXPECT(equalsXML<HybridBayesNet>(hbn));
EXPECT(equalsBinary<HybridBayesNet>(hbn));
}

/* ****************************************************************************/
// Test HybridBayesTree serialization.
TEST(HybridSerialization, HybridBayesTree) {
Switching s(2);
HybridBayesTree hbt = *(s.linearizedFactorGraph.eliminateMultifrontal());

EXPECT(equalsObj<HybridBayesTree>(hbt));
EXPECT(equalsXML<HybridBayesTree>(hbt));
EXPECT(equalsBinary<HybridBayesTree>(hbt));
}
// /* ****************************************************************************/
// // Test HybridGaussianConditional serialization.
// TEST(HybridSerialization, HybridGaussianConditional) {
// const DiscreteKey mode(M(0), 2);
// Matrix1 I = Matrix1::Identity();
// const auto conditional0 = std::make_shared<GaussianConditional>(
// GaussianConditional::FromMeanAndStddev(Z(0), I, X(0), Vector1(0), 0.5));
// const auto conditional1 = std::make_shared<GaussianConditional>(
// GaussianConditional::FromMeanAndStddev(Z(0), I, X(0), Vector1(0), 3));
// const HybridGaussianConditional gm(mode, {conditional0, conditional1});

// EXPECT(equalsObj<HybridGaussianConditional>(gm));
// EXPECT(equalsXML<HybridGaussianConditional>(gm));
// EXPECT(equalsBinary<HybridGaussianConditional>(gm));
// }

// /* ****************************************************************************/
// // Test HybridBayesNet serialization.
// TEST(HybridSerialization, HybridBayesNet) {
// Switching s(2);
// HybridBayesNet hbn = *(s.linearizedFactorGraph.eliminateSequential());

// EXPECT(equalsObj<HybridBayesNet>(hbn));
// EXPECT(equalsXML<HybridBayesNet>(hbn));
// EXPECT(equalsBinary<HybridBayesNet>(hbn));
// }

// /* ****************************************************************************/
// // Test HybridBayesTree serialization.
// TEST(HybridSerialization, HybridBayesTree) {
// Switching s(2);
// HybridBayesTree hbt = *(s.linearizedFactorGraph.eliminateMultifrontal());

// EXPECT(equalsObj<HybridBayesTree>(hbt));
// EXPECT(equalsXML<HybridBayesTree>(hbt));
// EXPECT(equalsBinary<HybridBayesTree>(hbt));
// }

/* ************************************************************************* */
int main() {
Expand Down

0 comments on commit 8d03e71

Please sign in to comment.