small improvements to comments and code structure
parent
6a26ecf971
commit
f7071298c3
|
@ -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<DecisionTreeFactor>(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();
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue