remove excessive Unique call to improve efficiency

release/4.3a0
Varun Agrawal 2023-06-08 10:36:21 -04:00
parent 68cb724970
commit be70ffcf01
2 changed files with 7 additions and 5 deletions

View File

@ -627,7 +627,7 @@ namespace gtsam {
NodePtr fi = compose(functions.begin(), functions.end(), label);
choiceOnHighestLabel->push_back(fi);
}
return Choice::Unique(choiceOnHighestLabel);
return choiceOnHighestLabel;
}
}
@ -691,8 +691,8 @@ namespace gtsam {
}
/****************************************************************************/
// Take a range of labels and a corresponding range of values,
// and creates a decision tree.
// Top-level factory method, which takes a range of labels and a corresponding
// range of values, and creates a decision tree.
template<typename L, typename Y>
template<typename It, typename ValueIt>
typename DecisionTree<L, Y>::NodePtr DecisionTree<L, Y>::create(

View File

@ -142,8 +142,10 @@ namespace gtsam {
template <typename It, typename ValueIt>
NodePtr build(It begin, It end, ValueIt beginY, ValueIt endY) const;
/** Internal helper function to create from keys, cardinalities,
* and Y values
/** Internal helper function to create from
* keys, cardinalities, and Y values.
* Calls `build` which builds thetree bottom-up,
* before we prune in a top-down fashion.
*/
template <typename It, typename ValueIt>
NodePtr create(It begin, It end, ValueIt beginY, ValueIt endY) const;