implement DiscreteFactor methods in Constraint
parent
0d5b03d609
commit
64aa0520ed
|
@ -87,6 +87,16 @@ class GTSAM_UNSTABLE_EXPORT Constraint : public DiscreteFactor {
|
|||
this->operator*(df->toDecisionTreeFactor()));
|
||||
}
|
||||
|
||||
/// Multiply by a scalar
|
||||
virtual DiscreteFactor::shared_ptr operator*(double s) const override {
|
||||
return this->toDecisionTreeFactor() * s;
|
||||
}
|
||||
|
||||
/// Multiply by a DecisionTreeFactor and return a DecisionTreeFactor
|
||||
DecisionTreeFactor operator*(const DecisionTreeFactor& dtf) const override {
|
||||
return this->toDecisionTreeFactor() * dtf;
|
||||
}
|
||||
|
||||
/// divide by DiscreteFactor::shared_ptr f (safely)
|
||||
DiscreteFactor::shared_ptr operator/(
|
||||
const DiscreteFactor::shared_ptr& df) const override {
|
||||
|
@ -104,6 +114,9 @@ class GTSAM_UNSTABLE_EXPORT Constraint : public DiscreteFactor {
|
|||
return toDecisionTreeFactor().sum(keys);
|
||||
}
|
||||
|
||||
/// Find the max value
|
||||
double max() const override { return toDecisionTreeFactor().max(); }
|
||||
|
||||
DiscreteFactor::shared_ptr max(size_t nrFrontals) const override {
|
||||
return toDecisionTreeFactor().max(nrFrontals);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue