Skip to content

Commit

Permalink
prune and then add to BayesNet
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal committed Jan 24, 2025
1 parent 26642f1 commit 2644c4b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gtsam/hybrid/HybridBayesNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ HybridBayesNet HybridBayesNet::prune(size_t maxNrLeaves,
joint = joint * (*conditional);
}

// Prune the joint. NOTE: imperative and, again, possibly quite expensive.
joint.prune(maxNrLeaves);

// Create the result starting with the pruned joint.
HybridBayesNet result;
result.emplace_shared<DiscreteConditional>(joint);
// Prune the joint. NOTE: imperative and, again, possibly quite expensive.
result.back()->asDiscrete()->prune(maxNrLeaves);

// Get pruned discrete probabilities so
// we can prune HybridGaussianConditionals.
Expand Down

0 comments on commit 2644c4b

Please sign in to comment.