diff --git a/gtsam/discrete/DecisionTreeFactor.h b/gtsam/discrete/DecisionTreeFactor.h index 6cce6e5d4..e90a2f96f 100644 --- a/gtsam/discrete/DecisionTreeFactor.h +++ b/gtsam/discrete/DecisionTreeFactor.h @@ -147,6 +147,9 @@ namespace gtsam { /// @name Advanced Interface /// @{ + /// Inherit all the `apply` methods from AlgebraicDecisionTree + using ADT::apply; + /** * Apply binary operator (*this) "op" f * @param f the second argument for op diff --git a/gtsam/hybrid/HybridBayesNet.cpp b/gtsam/hybrid/HybridBayesNet.cpp index 266e02b0d..9df58814b 100644 --- a/gtsam/hybrid/HybridBayesNet.cpp +++ b/gtsam/hybrid/HybridBayesNet.cpp @@ -155,18 +155,18 @@ void HybridBayesNet::updateDiscreteConditionals( auto discrete = conditional->asDiscrete(); // Convert pointer from conditional to factor - auto discreteTree = - std::dynamic_pointer_cast(discrete); + auto discreteFactor = + std::dynamic_pointer_cast(discrete); // Apply prunerFunc to the underlying AlgebraicDecisionTree - DecisionTreeFactor::ADT prunedDiscreteTree = - discreteTree->apply(prunerFunc(prunedDiscreteProbs, *conditional)); + DecisionTreeFactor::ADT prunedDiscreteFactor = + discreteFactor->apply(prunerFunc(prunedDiscreteProbs, *conditional)); gttic_(HybridBayesNet_MakeConditional); // Create the new (hybrid) conditional KeyVector frontals(discrete->frontals().begin(), discrete->frontals().end()); auto prunedDiscrete = std::make_shared( - frontals.size(), conditional->discreteKeys(), prunedDiscreteTree); + frontals.size(), conditional->discreteKeys(), prunedDiscreteFactor); conditional = std::make_shared(prunedDiscrete); gttoc_(HybridBayesNet_MakeConditional); diff --git a/gtsam/hybrid/HybridSmoother.cpp b/gtsam/hybrid/HybridSmoother.cpp index 56c62cf19..27d3f70fc 100644 --- a/gtsam/hybrid/HybridSmoother.cpp +++ b/gtsam/hybrid/HybridSmoother.cpp @@ -72,7 +72,8 @@ void HybridSmoother::update(HybridGaussianFactorGraph graph, addConditionals(graph, hybridBayesNet_, ordering); // Eliminate. - auto bayesNetFragment = graph.eliminateSequential(ordering); + HybridBayesNet::shared_ptr bayesNetFragment = + graph.eliminateSequential(ordering); /// Prune if (maxNrLeaves) {