From bee756e9bf73a8675a5369844d66387f99509e66 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Tue, 28 Jan 2025 02:47:49 -0500 Subject: [PATCH] time dead mode removal --- gtsam/hybrid/HybridBayesNet.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gtsam/hybrid/HybridBayesNet.cpp b/gtsam/hybrid/HybridBayesNet.cpp index e052ae04c..46fc771da 100644 --- a/gtsam/hybrid/HybridBayesNet.cpp +++ b/gtsam/hybrid/HybridBayesNet.cpp @@ -72,6 +72,10 @@ HybridBayesNet HybridBayesNet::prune( // If we have a dead mode threshold and discrete variables left after pruning, // then we run dead mode removal. if (deadModeThreshold.has_value() && pruned.keys().size() > 0) { +#if GTSAM_HYBRID_TIMING + gttic_(DeadModeRemoval); +#endif + DiscreteMarginals marginals(DiscreteFactorGraph{pruned}); for (auto dkey : pruned.discreteKeys()) { Vector probabilities = marginals.marginalProbabilities(dkey); @@ -108,6 +112,10 @@ HybridBayesNet HybridBayesNet::prune( std::dynamic_pointer_cast(marginals(key))); } +#if GTSAM_HYBRID_TIMING + gttoc_(DeadModeRemoval); +#endif + } else { result.emplace_shared(pruned); }