return DiscreteTableConditional from hybrid elimination
parent
34eb0fce9b
commit
462a5b8b3a
|
|
@ -271,11 +271,14 @@ static TableFactor ProductAndNormalize(const DiscreteFactorGraph &factors) {
|
||||||
TableFactor product;
|
TableFactor product;
|
||||||
for (auto &&factor : factors) {
|
for (auto &&factor : factors) {
|
||||||
if (factor) {
|
if (factor) {
|
||||||
if (auto f = std::dynamic_pointer_cast<TableFactor>(factor)) {
|
if (auto dtc =
|
||||||
|
std::dynamic_pointer_cast<DiscreteTableConditional>(factor)) {
|
||||||
|
product = product * dtc->table();
|
||||||
|
} else if (auto f = std::dynamic_pointer_cast<TableFactor>(factor)) {
|
||||||
product = product * (*f);
|
product = product * (*f);
|
||||||
} else if (auto dtf =
|
} else if (auto dtf =
|
||||||
std::dynamic_pointer_cast<DecisionTreeFactor>(factor)) {
|
std::dynamic_pointer_cast<DecisionTreeFactor>(factor)) {
|
||||||
product = TableFactor(product * (*dtf));
|
product = product * TableFactor(*dtf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -368,7 +371,7 @@ discreteElimination(const HybridGaussianFactorGraph &factors,
|
||||||
#endif
|
#endif
|
||||||
// Finally, get the conditional
|
// Finally, get the conditional
|
||||||
auto conditional =
|
auto conditional =
|
||||||
std::make_shared<DiscreteConditional>(product, *sum, orderedKeys);
|
std::make_shared<DiscreteTableConditional>(product, *sum, orderedKeys);
|
||||||
#if GTSAM_HYBRID_TIMING
|
#if GTSAM_HYBRID_TIMING
|
||||||
gttoc_(EliminateDiscreteFormDiscreteConditional);
|
gttoc_(EliminateDiscreteFormDiscreteConditional);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue