added comments and minor refactor
parent
8272854378
commit
0fb67995c6
|
|
@ -242,7 +242,7 @@ GaussianBayesNet HybridBayesNet::choose(
|
|||
|
||||
/* ************************************************************************* */
|
||||
HybridValues HybridBayesNet::optimize() const {
|
||||
// Solve for the MPE
|
||||
// Collect all the discrete factors to compute MPE
|
||||
DiscreteBayesNet discrete_bn;
|
||||
for (auto &&conditional : *this) {
|
||||
if (conditional->isDiscrete()) {
|
||||
|
|
@ -250,11 +250,11 @@ HybridValues HybridBayesNet::optimize() const {
|
|||
}
|
||||
}
|
||||
|
||||
// Solve for the MPE
|
||||
DiscreteValues mpe = DiscreteFactorGraph(discrete_bn).optimize();
|
||||
|
||||
// Given the MPE, compute the optimal continuous values.
|
||||
GaussianBayesNet gbn = this->choose(mpe);
|
||||
return HybridValues(mpe, gbn.optimize());
|
||||
return HybridValues(mpe, this->optimize(mpe));
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
|
|
|||
|
|
@ -100,8 +100,7 @@ HybridSmoother::addConditionals(const HybridGaussianFactorGraph &originalGraph,
|
|||
/* ************************************************************************* */
|
||||
GaussianMixture::shared_ptr HybridSmoother::gaussianMixture(
|
||||
size_t index) const {
|
||||
return boost::dynamic_pointer_cast<GaussianMixture>(
|
||||
hybridBayesNet_.at(index));
|
||||
return hybridBayesNet_.atMixture(index);
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
|
|
|||
Loading…
Reference in New Issue