add division with DiscreteFactor::shared_ptr for convenience

release/4.3a0
Varun Agrawal 2024-12-08 17:00:04 -05:00
parent 975fe627d9
commit fc2d33f437
1 changed files with 5 additions and 0 deletions

View File

@ -156,6 +156,11 @@ namespace gtsam {
return apply(f, safe_div); return apply(f, safe_div);
} }
/// divide by DiscreteFactor::shared_ptr f (safely)
DecisionTreeFactor operator/(const DiscreteFactor::shared_ptr& f) const {
return apply(*std::dynamic_pointer_cast<DecisionTreeFactor>(f), safe_div);
}
/// Convert into a decision tree /// Convert into a decision tree
DecisionTreeFactor toDecisionTreeFactor() const override { return *this; } DecisionTreeFactor toDecisionTreeFactor() const override { return *this; }