use DecisionTreeFactor version of sum and max where not available

release/4.3a0
Varun Agrawal 2025-01-05 19:40:37 -05:00
parent 5e9c1300db
commit b5128b2c9f
4 changed files with 16 additions and 16 deletions

View File

@ -84,19 +84,19 @@ class GTSAM_UNSTABLE_EXPORT AllDiff : public Constraint {
uint64_t nrValues() const override { return 1; };
DiscreteFactor::shared_ptr sum(size_t nrFrontals) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().sum(nrFrontals);
}
DiscreteFactor::shared_ptr sum(const Ordering& keys) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().sum(keys);
}
DiscreteFactor::shared_ptr max(size_t nrFrontals) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().max(nrFrontals);
}
DiscreteFactor::shared_ptr max(const Ordering& keys) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().max(keys);
}
};

View File

@ -108,19 +108,19 @@ class BinaryAllDiff : public Constraint {
uint64_t nrValues() const override { return 1; };
DiscreteFactor::shared_ptr sum(size_t nrFrontals) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().sum(nrFrontals);
}
DiscreteFactor::shared_ptr sum(const Ordering& keys) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().sum(keys);
}
DiscreteFactor::shared_ptr max(size_t nrFrontals) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().max(nrFrontals);
}
DiscreteFactor::shared_ptr max(const Ordering& keys) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().max(keys);
}
};

View File

@ -123,19 +123,19 @@ class GTSAM_UNSTABLE_EXPORT Domain : public Constraint {
Constraint::shared_ptr partiallyApply(const Domains& domains) const override;
DiscreteFactor::shared_ptr sum(size_t nrFrontals) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().sum(nrFrontals);
}
DiscreteFactor::shared_ptr sum(const Ordering& keys) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().sum(keys);
}
DiscreteFactor::shared_ptr max(size_t nrFrontals) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().max(nrFrontals);
}
DiscreteFactor::shared_ptr max(const Ordering& keys) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().max(keys);
}
};

View File

@ -89,19 +89,19 @@ class GTSAM_UNSTABLE_EXPORT SingleValue : public Constraint {
uint64_t nrValues() const override { return 1; };
DiscreteFactor::shared_ptr sum(size_t nrFrontals) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().sum(nrFrontals);
}
DiscreteFactor::shared_ptr sum(const Ordering& keys) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().sum(keys);
}
DiscreteFactor::shared_ptr max(size_t nrFrontals) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().max(nrFrontals);
}
DiscreteFactor::shared_ptr max(const Ordering& keys) const override {
throw std::runtime_error("Not implemented");
return toDecisionTreeFactor().max(keys);
}
};