kill toDecisionTreeFactor to force rethink

release/4.3a0
Varun Agrawal 2024-12-07 18:25:27 -05:00
parent b0ad350a20
commit 306a3bae52
4 changed files with 0 additions and 22 deletions

View File

@ -169,9 +169,6 @@ namespace gtsam {
} }
} }
/// Convert into a decision tree
DecisionTreeFactor toDecisionTreeFactor() const override { return *this; }
/// Create new factor by summing all values with the same separator values /// Create new factor by summing all values with the same separator values
DiscreteFactor::shared_ptr sum(size_t nrFrontals) const override { DiscreteFactor::shared_ptr sum(size_t nrFrontals) const override {
return combine(nrFrontals, ADT::Ring::add); return combine(nrFrontals, ADT::Ring::add);

View File

@ -113,8 +113,6 @@ class GTSAM_EXPORT DiscreteFactor : public Factor {
virtual DiscreteFactor::shared_ptr operator*( virtual DiscreteFactor::shared_ptr operator*(
const DiscreteFactor::shared_ptr&) const = 0; const DiscreteFactor::shared_ptr&) const = 0;
virtual DecisionTreeFactor toDecisionTreeFactor() const = 0;
/// Create new factor by summing all values with the same separator values /// Create new factor by summing all values with the same separator values
virtual DiscreteFactor::shared_ptr sum(size_t nrFrontals) const = 0; virtual DiscreteFactor::shared_ptr sum(size_t nrFrontals) const = 0;

View File

@ -180,20 +180,6 @@ DiscreteFactor::shared_ptr TableFactor::operator*(
} }
} }
/* ************************************************************************ */
DecisionTreeFactor TableFactor::toDecisionTreeFactor() const {
DiscreteKeys dkeys = discreteKeys();
std::vector<double> table;
for (auto i = 0; i < sparse_table_.size(); i++) {
table.push_back(sparse_table_.coeff(i));
}
gttic_(toDecisionTreeFactor_Constructor);
// NOTE(Varun): This constructor is really expensive!!
DecisionTreeFactor f(dkeys, table);
gttoc_(toDecisionTreeFactor_Constructor);
return f;
}
/* ************************************************************************ */ /* ************************************************************************ */
TableFactor TableFactor::choose(const DiscreteValues parent_assign, TableFactor TableFactor::choose(const DiscreteValues parent_assign,
DiscreteKeys parent_keys) const { DiscreteKeys parent_keys) const {

View File

@ -207,9 +207,6 @@ class GTSAM_EXPORT TableFactor : public DiscreteFactor {
} }
} }
/// Convert into a decisiontree
DecisionTreeFactor toDecisionTreeFactor() const override;
/// Create a TableFactor that is a subset of this TableFactor /// Create a TableFactor that is a subset of this TableFactor
TableFactor choose(const DiscreteValues assignments, TableFactor choose(const DiscreteValues assignments,
DiscreteKeys parent_keys) const; DiscreteKeys parent_keys) const;