Skip to content

Commit

Permalink
small improvements to comments and code structure
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal committed Jul 17, 2023
1 parent 0394ebe commit a2ed791
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions gtsam/hybrid/HybridBayesNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -152,7 +151,7 @@ void HybridBayesNet::updateDiscreteConditionals(
// Convert pointer from conditional to factor
auto discreteFactor =
std::dynamic_pointer_cast<DecisionTreeFactor>(discrete);
// Apply prunerFunc to the underlying AlgebraicDecisionTree
// Apply prunerFunc to the underlying conditional
DecisionTreeFactor::ADT prunedDiscreteFactor =
discreteFactor->apply(prunerFunc(prunedDiscreteProbs, *conditional));

Expand All @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion gtsam/hybrid/HybridSmoother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a2ed791

Please sign in to comment.