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