Fixed test to work with "hidden constant" scheme
parent
202a5a3264
commit
a5951d8d34
|
@ -616,7 +616,7 @@ TEST(HybridGaussianFactorGraph, assembleGraphTree) {
|
||||||
const int num_measurements = 1;
|
const int num_measurements = 1;
|
||||||
auto fg = tiny::createHybridGaussianFactorGraph(
|
auto fg = tiny::createHybridGaussianFactorGraph(
|
||||||
num_measurements, VectorValues{{Z(0), Vector1(5.0)}});
|
num_measurements, VectorValues{{Z(0), Vector1(5.0)}});
|
||||||
EXPECT_LONGS_EQUAL(4, fg.size());
|
EXPECT_LONGS_EQUAL(3, fg.size());
|
||||||
|
|
||||||
// Assemble graph tree:
|
// Assemble graph tree:
|
||||||
auto actual = fg.assembleGraphTree();
|
auto actual = fg.assembleGraphTree();
|
||||||
|
@ -628,7 +628,7 @@ TEST(HybridGaussianFactorGraph, assembleGraphTree) {
|
||||||
CHECK(mixture);
|
CHECK(mixture);
|
||||||
|
|
||||||
// Get prior factor:
|
// Get prior factor:
|
||||||
const auto gf = boost::dynamic_pointer_cast<HybridConditional>(fg.at(2));
|
const auto gf = boost::dynamic_pointer_cast<HybridConditional>(fg.at(1));
|
||||||
CHECK(gf);
|
CHECK(gf);
|
||||||
using GF = GaussianFactor::shared_ptr;
|
using GF = GaussianFactor::shared_ptr;
|
||||||
const GF prior = gf->asGaussian();
|
const GF prior = gf->asGaussian();
|
||||||
|
@ -701,7 +701,7 @@ TEST(HybridGaussianFactorGraph, EliminateTiny1) {
|
||||||
auto bn = tiny::createHybridBayesNet(num_measurements);
|
auto bn = tiny::createHybridBayesNet(num_measurements);
|
||||||
auto fg = bn.toFactorGraph(measurements);
|
auto fg = bn.toFactorGraph(measurements);
|
||||||
GTSAM_PRINT(bn);
|
GTSAM_PRINT(bn);
|
||||||
EXPECT_LONGS_EQUAL(4, fg.size());
|
EXPECT_LONGS_EQUAL(3, fg.size());
|
||||||
|
|
||||||
EXPECT(ratioTest(bn, measurements, fg));
|
EXPECT(ratioTest(bn, measurements, fg));
|
||||||
|
|
||||||
|
@ -738,7 +738,7 @@ TEST(HybridGaussianFactorGraph, EliminateTiny2) {
|
||||||
const VectorValues measurements{{Z(0), Vector1(4.0)}, {Z(1), Vector1(6.0)}};
|
const VectorValues measurements{{Z(0), Vector1(4.0)}, {Z(1), Vector1(6.0)}};
|
||||||
auto bn = tiny::createHybridBayesNet(num_measurements);
|
auto bn = tiny::createHybridBayesNet(num_measurements);
|
||||||
auto fg = bn.toFactorGraph(measurements);
|
auto fg = bn.toFactorGraph(measurements);
|
||||||
EXPECT_LONGS_EQUAL(6, fg.size());
|
EXPECT_LONGS_EQUAL(4, fg.size());
|
||||||
|
|
||||||
// Create expected Bayes Net:
|
// Create expected Bayes Net:
|
||||||
HybridBayesNet expectedBayesNet;
|
HybridBayesNet expectedBayesNet;
|
||||||
|
@ -775,7 +775,7 @@ TEST(HybridGaussianFactorGraph, EliminateTiny22) {
|
||||||
auto bn = tiny::createHybridBayesNet(num_measurements, manyModes);
|
auto bn = tiny::createHybridBayesNet(num_measurements, manyModes);
|
||||||
const VectorValues measurements{{Z(0), Vector1(4.0)}, {Z(1), Vector1(6.0)}};
|
const VectorValues measurements{{Z(0), Vector1(4.0)}, {Z(1), Vector1(6.0)}};
|
||||||
auto fg = bn.toFactorGraph(measurements);
|
auto fg = bn.toFactorGraph(measurements);
|
||||||
EXPECT_LONGS_EQUAL(7, fg.size());
|
EXPECT_LONGS_EQUAL(5, fg.size());
|
||||||
|
|
||||||
EXPECT(ratioTest(bn, measurements, fg));
|
EXPECT(ratioTest(bn, measurements, fg));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue