Skip to content

Commit

Permalink
move operator/ to Constraint.h
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal committed Jan 6, 2025
1 parent ab2fe37 commit 7561da4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
6 changes: 0 additions & 6 deletions gtsam_unstable/discrete/AllDiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions gtsam_unstable/discrete/Constraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// @{
Expand Down
6 changes: 0 additions & 6 deletions gtsam_unstable/discrete/Domain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 0 additions & 6 deletions gtsam_unstable/discrete/SingleValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 7561da4

Please sign in to comment.