time dead mode removal
parent
cbf8bc2f7c
commit
bee756e9bf
|
@ -72,6 +72,10 @@ HybridBayesNet HybridBayesNet::prune(
|
||||||
// If we have a dead mode threshold and discrete variables left after pruning,
|
// If we have a dead mode threshold and discrete variables left after pruning,
|
||||||
// then we run dead mode removal.
|
// then we run dead mode removal.
|
||||||
if (deadModeThreshold.has_value() && pruned.keys().size() > 0) {
|
if (deadModeThreshold.has_value() && pruned.keys().size() > 0) {
|
||||||
|
#if GTSAM_HYBRID_TIMING
|
||||||
|
gttic_(DeadModeRemoval);
|
||||||
|
#endif
|
||||||
|
|
||||||
DiscreteMarginals marginals(DiscreteFactorGraph{pruned});
|
DiscreteMarginals marginals(DiscreteFactorGraph{pruned});
|
||||||
for (auto dkey : pruned.discreteKeys()) {
|
for (auto dkey : pruned.discreteKeys()) {
|
||||||
Vector probabilities = marginals.marginalProbabilities(dkey);
|
Vector probabilities = marginals.marginalProbabilities(dkey);
|
||||||
|
@ -108,6 +112,10 @@ HybridBayesNet HybridBayesNet::prune(
|
||||||
std::dynamic_pointer_cast<DiscreteConditional>(marginals(key)));
|
std::dynamic_pointer_cast<DiscreteConditional>(marginals(key)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if GTSAM_HYBRID_TIMING
|
||||||
|
gttoc_(DeadModeRemoval);
|
||||||
|
#endif
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
result.emplace_shared<DiscreteConditional>(pruned);
|
result.emplace_shared<DiscreteConditional>(pruned);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue