'push_back' entire factor graph instead of individual 'factors'

release/4.3a0
Ankur Roy Chowdhury 2023-03-06 14:58:50 -08:00
parent e075f18011
commit fac3590994
1 changed files with 3 additions and 5 deletions

View File

@ -27,9 +27,8 @@ namespace gtsam {
Ordering HybridSmoother::getOrdering(
const HybridGaussianFactorGraph &newFactors) {
HybridGaussianFactorGraph factors(hybridBayesNet());
for(auto& factor: newFactors){
factors.push_back(factor);
}
factors.push_back(newFactors);
// Get all the discrete keys from the factors
KeySet allDiscrete = factors.discreteKeySet();
@ -74,8 +73,7 @@ void HybridSmoother::update(HybridGaussianFactorGraph graph,
HybridBayesNet prunedBayesNetFragment =
bayesNetFragment->prune(*maxNrLeaves);
// Set the bayes net fragment to the pruned version
bayesNetFragment =
std::make_shared<HybridBayesNet>(prunedBayesNetFragment);
bayesNetFragment = std::make_shared<HybridBayesNet>(prunedBayesNetFragment);
}
// Add the partial bayes net to the posterior bayes net.