@@ -108,7 +108,7 @@ TEST(HybridBayesNet, evaluateHybrid) {
108
108
HybridBayesNet bayesNet;
109
109
bayesNet.push_back (continuousConditional);
110
110
bayesNet.emplace_shared <HybridGaussianConditional>(
111
- KeyVector{X (1 )}, KeyVector{}, DiscreteKeys{ Asia} ,
111
+ KeyVector{X (1 )}, KeyVector{}, Asia,
112
112
std::vector{conditional0, conditional1});
113
113
bayesNet.emplace_shared <DiscreteConditional>(Asia, " 99/1" );
114
114
@@ -169,7 +169,7 @@ TEST(HybridBayesNet, Error) {
169
169
X (1 ), Vector1::Constant (2 ), I_1x1, model1);
170
170
171
171
auto gm = std::make_shared<HybridGaussianConditional>(
172
- KeyVector{X (1 )}, KeyVector{}, DiscreteKeys{ Asia} ,
172
+ KeyVector{X (1 )}, KeyVector{}, Asia,
173
173
std::vector{conditional0, conditional1});
174
174
// Create hybrid Bayes net.
175
175
HybridBayesNet bayesNet;
@@ -383,17 +383,16 @@ TEST(HybridBayesNet, Sampling) {
383
383
HybridNonlinearFactorGraph nfg;
384
384
385
385
auto noise_model = noiseModel::Diagonal::Sigmas (Vector1 (1.0 ));
386
+ nfg.emplace_shared <PriorFactor<double >>(X (0 ), 0.0 , noise_model);
387
+
386
388
auto zero_motion =
387
389
std::make_shared<BetweenFactor<double >>(X (0 ), X (1 ), 0 , noise_model);
388
390
auto one_motion =
389
391
std::make_shared<BetweenFactor<double >>(X (0 ), X (1 ), 1 , noise_model);
390
-
391
- DiscreteKeys discreteKeys{DiscreteKey (M (0 ), 2 )};
392
- HybridNonlinearFactor::Factors factors (
393
- discreteKeys, {{zero_motion, 0.0 }, {one_motion, 0.0 }});
394
- nfg.emplace_shared <PriorFactor<double >>(X (0 ), 0.0 , noise_model);
395
- nfg.emplace_shared <HybridNonlinearFactor>(KeyVector{X (0 ), X (1 )}, discreteKeys,
396
- factors);
392
+ nfg.emplace_shared <HybridNonlinearFactor>(
393
+ KeyVector{X (0 ), X (1 )}, DiscreteKey (M (0 ), 2 ),
394
+ std::vector<NonlinearFactorValuePair>{{zero_motion, 0.0 },
395
+ {one_motion, 0.0 }});
397
396
398
397
DiscreteKey mode (M (0 ), 2 );
399
398
nfg.emplace_shared <DiscreteDistribution>(mode, " 1/1" );
0 commit comments