Skip to content

Commit 24ec30e

Browse files
committed
replace emplace_back with emplace_shared
1 parent 05a4b7a commit 24ec30e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

gtsam/hybrid/tests/testGaussianMixtureFactor.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -629,12 +629,12 @@ static HybridGaussianFactorGraph GetFactorGraphFromBayesNet(
629629
{X(0), H1_1 /*Sp1*/},
630630
{X(1), H1_2 /*Tp2*/}};
631631
// Create conditional P(Z1 | X1, X2, M1)
632-
auto gm = new gtsam::GaussianMixture(
633-
{Z(1)}, {X(0), X(1)}, {m1},
634-
{std::make_shared<GaussianConditional>(terms0, 1, -d0, model0),
635-
std::make_shared<GaussianConditional>(terms1, 1, -d1, model1)});
632+
auto conditionals = std::vector{
633+
std::make_shared<GaussianConditional>(terms0, 1, -d0, model0),
634+
std::make_shared<GaussianConditional>(terms1, 1, -d1, model1)};
636635
gtsam::HybridBayesNet bn;
637-
bn.emplace_back(gm);
636+
bn.emplace_shared<GaussianMixture>(KeyVector{Z(1)}, KeyVector{X(0), X(1)},
637+
DiscreteKeys{m1}, conditionals);
638638

639639
// Create FG via toFactorGraph
640640
gtsam::VectorValues measurements;

0 commit comments

Comments
 (0)