fix toDecisionTreeFactor so the keys are ordered correctly

release/4.3a0
Varun Agrawal 2024-12-15 16:03:10 -05:00
parent 293c29ebf8
commit 8fefbbf06a
1 changed files with 3 additions and 3 deletions

View File

@ -153,8 +153,7 @@ TableFactor::TableFactor(const DiscreteKeys& dkeys,
/* ************************************************************************ */ /* ************************************************************************ */
TableFactor::TableFactor(const DecisionTreeFactor& dtf) TableFactor::TableFactor(const DecisionTreeFactor& dtf)
: TableFactor(dtf.discreteKeys(), : TableFactor(dtf.discreteKeys(), dtf) {}
ComputeSparseTable(dtf.discreteKeys(), dtf)) {}
/* ************************************************************************ */ /* ************************************************************************ */
TableFactor::TableFactor(const DiscreteConditional& c) TableFactor::TableFactor(const DiscreteConditional& c)
@ -278,7 +277,8 @@ DecisionTreeFactor TableFactor::toDecisionTreeFactor() const {
table.push_back(pair.second); table.push_back(pair.second);
}); });
DecisionTreeFactor f(rdkeys, table); AlgebraicDecisionTree<Key> tree(rdkeys, table);
DecisionTreeFactor f(dkeys, tree);
return f; return f;
} }