diff --git a/gtsam/hybrid/HybridSmoother.cpp b/gtsam/hybrid/HybridSmoother.cpp index b06e4de4e..b1164c821 100644 --- a/gtsam/hybrid/HybridSmoother.cpp +++ b/gtsam/hybrid/HybridSmoother.cpp @@ -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(prunedBayesNetFragment); + bayesNetFragment = std::make_shared(prunedBayesNetFragment); } // Add the partial bayes net to the posterior bayes net.