remove GTSAM_HYBRID_TIMING guards
parent
42f8e54c2a
commit
47e76ff03b
|
@ -121,25 +121,13 @@ namespace gtsam {
|
|||
static DecisionTreeFactor ProductAndNormalize(
|
||||
const DiscreteFactorGraph& factors) {
|
||||
// PRODUCT: multiply all factors
|
||||
#if GTSAM_HYBRID_TIMING
|
||||
gttic_(DiscreteProduct);
|
||||
#endif
|
||||
DecisionTreeFactor product = factors.product();
|
||||
#if GTSAM_HYBRID_TIMING
|
||||
gttoc_(DiscreteProduct);
|
||||
#endif
|
||||
|
||||
// Max over all the potentials by pretending all keys are frontal:
|
||||
auto normalizer = product.max(product.size());
|
||||
|
||||
#if GTSAM_HYBRID_TIMING
|
||||
gttic_(DiscreteNormalize);
|
||||
#endif
|
||||
// Normalize the product factor to prevent underflow.
|
||||
product = product / (*normalizer);
|
||||
#if GTSAM_HYBRID_TIMING
|
||||
gttoc_(DiscreteNormalize);
|
||||
#endif
|
||||
|
||||
return product;
|
||||
}
|
||||
|
@ -230,13 +218,7 @@ namespace gtsam {
|
|||
DecisionTreeFactor product = ProductAndNormalize(factors);
|
||||
|
||||
// sum out frontals, this is the factor on the separator
|
||||
#if GTSAM_HYBRID_TIMING
|
||||
gttic_(EliminateDiscreteSum);
|
||||
#endif
|
||||
DecisionTreeFactor::shared_ptr sum = product.sum(frontalKeys);
|
||||
#if GTSAM_HYBRID_TIMING
|
||||
gttoc_(EliminateDiscreteSum);
|
||||
#endif
|
||||
|
||||
// Ordering keys for the conditional so that frontalKeys are really in front
|
||||
Ordering orderedKeys;
|
||||
|
@ -246,14 +228,8 @@ namespace gtsam {
|
|||
sum->keys().end());
|
||||
|
||||
// now divide product/sum to get conditional
|
||||
#if GTSAM_HYBRID_TIMING
|
||||
gttic_(EliminateDiscreteToDiscreteConditional);
|
||||
#endif
|
||||
auto conditional =
|
||||
std::make_shared<DiscreteConditional>(product, *sum, orderedKeys);
|
||||
#if GTSAM_HYBRID_TIMING
|
||||
gttoc_(EliminateDiscreteToDiscreteConditional);
|
||||
#endif
|
||||
|
||||
return {conditional, sum};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue