Fix some merging-dependent tests
parent
43544ae194
commit
6f11b4a870
|
@ -318,21 +318,27 @@ TEST(HybridGaussianConditional, Restrict) {
|
|||
const auto hc =
|
||||
std::make_shared<HybridConditional>(two_mode_measurement::hgc);
|
||||
|
||||
const HybridConditional::shared_ptr same = hc->restrict({});
|
||||
const auto same =
|
||||
std::dynamic_pointer_cast<HybridConditional>(hc->restrict({}));
|
||||
CHECK(same);
|
||||
EXPECT(same->isHybrid());
|
||||
EXPECT(same->asHybrid()->nrComponents() == 4);
|
||||
|
||||
const HybridConditional::shared_ptr oneParent = hc->restrict({{M(1), 0}});
|
||||
const auto oneParent =
|
||||
std::dynamic_pointer_cast<HybridConditional>(hc->restrict({{M(1), 0}}));
|
||||
CHECK(oneParent);
|
||||
EXPECT(oneParent->isHybrid());
|
||||
EXPECT(oneParent->asHybrid()->nrComponents() == 2);
|
||||
|
||||
const HybridConditional::shared_ptr oneParent2 =
|
||||
hc->restrict({{M(7), 0}, {M(1), 0}});
|
||||
const auto oneParent2 = std::dynamic_pointer_cast<HybridConditional>(
|
||||
hc->restrict({{M(7), 0}, {M(1), 0}}));
|
||||
CHECK(oneParent2);
|
||||
EXPECT(oneParent2->isHybrid());
|
||||
EXPECT(oneParent2->asHybrid()->nrComponents() == 2);
|
||||
|
||||
const HybridConditional::shared_ptr gaussian =
|
||||
hc->restrict({{M(1), 0}, {M(2), 1}});
|
||||
const auto gaussian = std::dynamic_pointer_cast<HybridConditional>(
|
||||
hc->restrict({{M(1), 0}, {M(2), 1}}));
|
||||
CHECK(gaussian);
|
||||
EXPECT(gaussian->asGaussian());
|
||||
}
|
||||
|
||||
|
|
|
@ -102,12 +102,16 @@ TEST(HybridSmoother, IncrementalSmoother) {
|
|||
graph.resize(0);
|
||||
}
|
||||
|
||||
EXPECT_LONGS_EQUAL(11,
|
||||
smoother.hybridBayesNet().at(5)->asDiscrete()->nrValues());
|
||||
auto& hybridBayesNet = smoother.hybridBayesNet();
|
||||
#ifdef GTSAM_DT_MERGING
|
||||
EXPECT_LONGS_EQUAL(11, hybridBayesNet.at(5)->asDiscrete()->nrValues());
|
||||
#else
|
||||
EXPECT_LONGS_EQUAL(16, hybridBayesNet.at(5)->asDiscrete()->nrValues());
|
||||
#endif
|
||||
|
||||
// Get the continuous delta update as well as
|
||||
// the optimal discrete assignment.
|
||||
HybridValues delta = smoother.hybridBayesNet().optimize();
|
||||
HybridValues delta = hybridBayesNet.optimize();
|
||||
|
||||
// Check discrete assignment
|
||||
DiscreteValues expected_discrete;
|
||||
|
@ -156,8 +160,12 @@ TEST(HybridSmoother, ValidPruningError) {
|
|||
graph.resize(0);
|
||||
}
|
||||
|
||||
EXPECT_LONGS_EQUAL(14,
|
||||
smoother.hybridBayesNet().at(8)->asDiscrete()->nrValues());
|
||||
auto& hybridBayesNet = smoother.hybridBayesNet();
|
||||
#ifdef GTSAM_DT_MERGING
|
||||
EXPECT_LONGS_EQUAL(14, hybridBayesNet.at(8)->asDiscrete()->nrValues());
|
||||
#else
|
||||
EXPECT_LONGS_EQUAL(128, hybridBayesNet.at(8)->asDiscrete()->nrValues());
|
||||
#endif
|
||||
|
||||
// Get the continuous delta update as well as
|
||||
// the optimal discrete assignment.
|
||||
|
|
Loading…
Reference in New Issue