simplify the error addition
parent
02d7b877a3
commit
878eeb5d73
|
|
@ -461,15 +461,8 @@ AlgebraicDecisionTree<Key> HybridGaussianFactorGraph::error(
|
||||||
// If factor is hybrid, select based on assignment.
|
// If factor is hybrid, select based on assignment.
|
||||||
GaussianMixtureFactor::shared_ptr gaussianMixture =
|
GaussianMixtureFactor::shared_ptr gaussianMixture =
|
||||||
boost::static_pointer_cast<GaussianMixtureFactor>(factors_.at(idx));
|
boost::static_pointer_cast<GaussianMixtureFactor>(factors_.at(idx));
|
||||||
// Compute factor error.
|
// Compute factor error and add it.
|
||||||
factor_error = gaussianMixture->error(continuousValues);
|
error_tree = error_tree + gaussianMixture->error(continuousValues);
|
||||||
|
|
||||||
// If first factor, assign error, else add it.
|
|
||||||
if (idx == 0) {
|
|
||||||
error_tree = factor_error;
|
|
||||||
} else {
|
|
||||||
error_tree = error_tree + factor_error;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (factors_.at(idx)->isContinuous()) {
|
} else if (factors_.at(idx)->isContinuous()) {
|
||||||
// If continuous only, get the (double) error
|
// If continuous only, get the (double) error
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue