diff --git a/gtsam/hybrid/HybridBayesNet.cpp b/gtsam/hybrid/HybridBayesNet.cpp index 3b5ab5b800..ff2752bcbe 100644 --- a/gtsam/hybrid/HybridBayesNet.cpp +++ b/gtsam/hybrid/HybridBayesNet.cpp @@ -39,8 +39,7 @@ bool HybridBayesNet::equals(const This &bn, double tol) const { /* ************************************************************************* */ DiscreteConditional::shared_ptr HybridBayesNet::discreteConditionals() const { - // The canonical decision tree factor which will get - // the discrete conditionals added to it. + // The joint discrete probability. DiscreteConditional discreteProbs; for (auto &&conditional : *this) { @@ -152,7 +151,7 @@ void HybridBayesNet::updateDiscreteConditionals( // Convert pointer from conditional to factor auto discreteFactor = std::dynamic_pointer_cast(discrete); - // Apply prunerFunc to the underlying AlgebraicDecisionTree + // Apply prunerFunc to the underlying conditional DecisionTreeFactor::ADT prunedDiscreteFactor = discreteFactor->apply(prunerFunc(prunedDiscreteProbs, *conditional)); @@ -173,7 +172,7 @@ void HybridBayesNet::updateDiscreteConditionals( /* ************************************************************************* */ HybridBayesNet HybridBayesNet::prune(size_t maxNrLeaves) { - // Get the decision tree of only the discrete keys + // Get the joint distribution of only the discrete keys gttic_(HybridBayesNet_PruneDiscreteConditionals); DiscreteConditional::shared_ptr discreteConditionals = this->discreteConditionals(); diff --git a/gtsam/hybrid/HybridSmoother.cpp b/gtsam/hybrid/HybridSmoother.cpp index 27d3f70fcb..afa8340d2b 100644 --- a/gtsam/hybrid/HybridSmoother.cpp +++ b/gtsam/hybrid/HybridSmoother.cpp @@ -97,7 +97,8 @@ HybridSmoother::addConditionals(const HybridGaussianFactorGraph &originalGraph, HybridGaussianFactorGraph graph(originalGraph); HybridBayesNet hybridBayesNet(originalHybridBayesNet); - // If we are not at the first iteration, means we have conditionals to add. + // If hybridBayesNet is not empty, + // it means we have conditionals to add to the factor graph. if (!hybridBayesNet.empty()) { // We add all relevant conditional mixtures on the last continuous variable // in the previous `hybridBayesNet` to the graph