Add all discrete keys

release/4.3a0
Frank Dellaert 2023-01-07 08:11:44 -08:00
parent 4e8dc6e34b
commit 84037e173f
1 changed files with 6 additions and 2 deletions

View File

@ -62,8 +62,12 @@ struct HybridConstructorTraversalData {
// Add all the discrete keys in the hybrid factors to the current data
for (const auto& f : node->factors) {
if (auto p = boost::dynamic_pointer_cast<HybridFactor>(f)) {
for (auto& k : p->discreteKeys()) {
if (auto hf = boost::dynamic_pointer_cast<HybridFactor>(f)) {
for (auto& k : hf->discreteKeys()) {
data.discreteKeys.insert(k.first);
}
} else if (auto hf = boost::dynamic_pointer_cast<DecisionTreeFactor>(f)) {
for (auto& k : hf->discreteKeys()) {
data.discreteKeys.insert(k.first);
}
}