add note about toDecisionTreeFactor

release/4.3a0
Varun Agrawal 2024-12-07 18:22:30 -05:00
parent 6c4546779a
commit b0ad350a20
1 changed files with 1 additions and 2 deletions

View File

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