update tests
parent
0ee9aac434
commit
d5160f7006
|
|
@ -544,8 +544,7 @@ std::shared_ptr<HybridGaussianFactor> mixedVarianceFactor(
|
||||||
|
|
||||||
auto func =
|
auto func =
|
||||||
[&](const Assignment<Key>& assignment,
|
[&](const Assignment<Key>& assignment,
|
||||||
const GaussianFactorValuePair& gfv) -> GaussianFactorValuePair {
|
const GaussianFactor::shared_ptr& gf) -> GaussianFactorValuePair {
|
||||||
auto [gf, val] = gfv;
|
|
||||||
if (assignment.at(mode) != tight_index) {
|
if (assignment.at(mode) != tight_index) {
|
||||||
double factor_log_constant = -0.5 * d * log2pi + log(1.0 / noise_loose);
|
double factor_log_constant = -0.5 * d * log2pi + log(1.0 / noise_loose);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ TEST(HybridGaussianConditional, Likelihood2) {
|
||||||
// Check the detailed JacobianFactor calculation for mode==1.
|
// Check the detailed JacobianFactor calculation for mode==1.
|
||||||
{
|
{
|
||||||
// We have a JacobianFactor
|
// We have a JacobianFactor
|
||||||
const auto gf1 = (*likelihood)(assignment1).first;
|
const auto gf1 = (*likelihood)(assignment1);
|
||||||
const auto jf1 = std::dynamic_pointer_cast<JacobianFactor>(gf1);
|
const auto jf1 = std::dynamic_pointer_cast<JacobianFactor>(gf1);
|
||||||
CHECK(jf1);
|
CHECK(jf1);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -734,8 +734,8 @@ TEST(HybridGaussianFactorGraph, assembleGraphTree) {
|
||||||
// Expected decision tree with two factor graphs:
|
// Expected decision tree with two factor graphs:
|
||||||
// f(x0;mode=0)P(x0) and f(x0;mode=1)P(x0)
|
// f(x0;mode=0)P(x0) and f(x0;mode=1)P(x0)
|
||||||
GaussianFactorGraphTree expected{
|
GaussianFactorGraphTree expected{
|
||||||
M(0), GaussianFactorGraph(std::vector<GF>{(*mixture)(d0).first, prior}),
|
M(0), GaussianFactorGraph(std::vector<GF>{(*mixture)(d0), prior}),
|
||||||
GaussianFactorGraph(std::vector<GF>{(*mixture)(d1).first, prior})};
|
GaussianFactorGraph(std::vector<GF>{(*mixture)(d1), prior})};
|
||||||
|
|
||||||
EXPECT(assert_equal(expected(d0), actual(d0), 1e-5));
|
EXPECT(assert_equal(expected(d0), actual(d0), 1e-5));
|
||||||
EXPECT(assert_equal(expected(d1), actual(d1), 1e-5));
|
EXPECT(assert_equal(expected(d1), actual(d1), 1e-5));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue