Skip to content

Commit

Permalink
better check for discrete factors
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal committed Nov 4, 2024
1 parent 6b3cb65 commit a7b53ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gtsam/hybrid/HybridGaussianFactorGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,9 @@ GaussianFactorGraph HybridGaussianFactorGraph::choose(
DiscreteFactorGraph HybridGaussianFactorGraph::discreteFactors() const {
DiscreteFactorGraph dfg;
for (auto &&f : factors_) {
auto discreteFactor = std::dynamic_pointer_cast<DiscreteFactor>(f);
assert(discreteFactor);
dfg.push_back(discreteFactor);
if (auto discreteFactor = std::dynamic_pointer_cast<DiscreteFactor>(f)) {
dfg.push_back(discreteFactor);
}
}
return dfg;
}
Expand Down

0 comments on commit a7b53ae

Please sign in to comment.