Make testcase exactly 5.0 mean

release/4.3a0
Frank Dellaert 2023-01-01 17:44:39 -05:00
parent 0095f73130
commit 665cb29b3f
2 changed files with 5 additions and 6 deletions

View File

@ -81,7 +81,7 @@ HybridGaussianFactorGraph createHybridGaussianFactorGraph(
// Create a deterministic set of measurements:
HybridValues values{{}, {{M(0), 0}}};
for (int i = 0; i < num_measurements; i++) {
values.insert(Z(i), Vector1(4.0 + 1.0 * i));
values.insert(Z(i), Vector1(5.0 + 1.0 * i));
}
return convertBayesNet(bayesNet, values);
} else {

View File

@ -653,12 +653,11 @@ TEST(HybridGaussianFactorGraph, SumFrontals) {
// Create Gaussian mixture on X(0).
using tiny::mode;
// regression, but mean checked to be 5.0 in both cases:
const auto conditional0 = boost::make_shared<GaussianConditional>(
X(0), Vector1(12.7279),
I_1x1 * 2.82843); // regression, but mean checked to be 4.5
const auto conditional1 = boost::make_shared<GaussianConditional>(
X(0), Vector1(10.0831),
I_1x1 * 2.02759); // regression, but mean 4.97297is close to prior.
X(0), Vector1(14.1421), I_1x1 * 2.82843),
conditional1 = boost::make_shared<GaussianConditional>(
X(0), Vector1(10.1379), I_1x1 * 2.02759);
GaussianMixture gm({X(0)}, {}, {mode}, {conditional0, conditional1});
bayesNet.emplaceMixture(gm); // copy :-(