move operator/ to Constraint.h

release/4.3a0
Varun Agrawal 2025-01-06 13:35:45 -05:00
parent ab2fe3707c
commit 7561da4df2
4 changed files with 6 additions and 18 deletions

View File

@ -56,12 +56,6 @@ DecisionTreeFactor AllDiff::operator*(const DecisionTreeFactor& f) const {
return toDecisionTreeFactor() * f;
}
/* ************************************************************************* */
DiscreteFactor::shared_ptr AllDiff::operator/(
const DiscreteFactor::shared_ptr& df) const {
return this->toDecisionTreeFactor() / df;
}
/* ************************************************************************* */
bool AllDiff::ensureArcConsistency(Key j, Domains* domains) const {
Domain& Dj = domains->at(j);

View File

@ -86,6 +86,12 @@ class GTSAM_UNSTABLE_EXPORT Constraint : public DiscreteFactor {
this->operator*(df->toDecisionTreeFactor()));
}
/// divide by DiscreteFactor::shared_ptr f (safely)
DiscreteFactor::shared_ptr operator/(
const DiscreteFactor::shared_ptr& df) const override {
return this->toDecisionTreeFactor() / df;
}
/// @}
/// @name Wrapper support
/// @{

View File

@ -49,12 +49,6 @@ DecisionTreeFactor Domain::operator*(const DecisionTreeFactor& f) const {
return toDecisionTreeFactor() * f;
}
/* ************************************************************************* */
DiscreteFactor::shared_ptr Domain::operator/(
const DiscreteFactor::shared_ptr& df) const {
return this->toDecisionTreeFactor() / df;
}
/* ************************************************************************* */
bool Domain::ensureArcConsistency(Key j, Domains* domains) const {
if (j != key()) throw invalid_argument("Domain check on wrong domain");

View File

@ -41,12 +41,6 @@ DecisionTreeFactor SingleValue::operator*(const DecisionTreeFactor& f) const {
return toDecisionTreeFactor() * f;
}
/* ************************************************************************* */
DiscreteFactor::shared_ptr SingleValue::operator/(
const DiscreteFactor::shared_ptr& df) const {
return this->toDecisionTreeFactor() / df;
}
/* ************************************************************************* */
bool SingleValue::ensureArcConsistency(Key j, Domains* domains) const {
if (j != keys_[0])