Commit 939fdcc 1 parent d145872 commit 939fdcc Copy full SHA for 939fdcc
File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -542,10 +542,15 @@ AlgebraicDecisionTree<Key> HybridGaussianFactorGraph::errorTree(
542
542
// Iterate over each factor.
543
543
for (auto &factor : factors_) {
544
544
if (auto f = std::dynamic_pointer_cast<HybridFactor>(factor)) {
545
+ // Check for HybridFactor, and call errorTree
545
546
error_tree = error_tree + f->errorTree (continuousValues);
546
- } else if (auto f = std::dynamic_pointer_cast<GaussianFactor>(factor)) {
547
- error_tree =
548
- error_tree + AlgebraicDecisionTree<Key>(f->error (continuousValues));
547
+ } else if (auto f = std::dynamic_pointer_cast<DiscreteFactor>(factor)) {
548
+ // Skip discrete factors
549
+ continue ;
550
+ } else {
551
+ // Everything else is a continuous only factor
552
+ HybridValues hv (continuousValues, DiscreteValues ());
553
+ error_tree = error_tree + AlgebraicDecisionTree<Key>(factor->error (hv));
549
554
}
550
555
}
551
556
return error_tree;
You can’t perform that action at this time.
0 commit comments