Some small doc changes

release/4.3a0
Frank Dellaert 2022-01-03 11:07:28 -05:00
parent 8a28ac2426
commit 6cd3eeb692
3 changed files with 11 additions and 18 deletions

View File

@ -158,7 +158,7 @@ namespace gtsam {
return this->combine(labelC, &Ring::add); return this->combine(labelC, &Ring::add);
} }
/// print method customized to node type `double`. /// print method customized to value type `double`.
void print(const std::string& s, void print(const std::string& s,
const typename Base::LabelFormatter& labelFormatter = const typename Base::LabelFormatter& labelFormatter =
&DefaultFormatter) const { &DefaultFormatter) const {
@ -168,7 +168,7 @@ namespace gtsam {
Base::print(s, labelFormatter, valueFormatter); Base::print(s, labelFormatter, valueFormatter);
} }
/// Equality method customized to node type `double`. /// Equality method customized to value type `double`.
bool equals(const AlgebraicDecisionTree& other, double tol = 1e-9) const { bool equals(const AlgebraicDecisionTree& other, double tol = 1e-9) const {
// lambda for comparison of two doubles upto some tolerance. // lambda for comparison of two doubles upto some tolerance.
auto compare = [tol](double a, double b) { auto compare = [tol](double a, double b) {

View File

@ -86,8 +86,8 @@ namespace gtsam {
* @brief Print method. * @brief Print method.
* *
* @param s Prefix string. * @param s Prefix string.
* @param labelFormatter Functor to format the node label. * @param labelFormatter Functor to format the labels of type L.
* @param valueFormatter Functor to format the node value. * @param valueFormatter Functor to format the values of type Y.
*/ */
void print(const std::string& s, const LabelFormatter& labelFormatter, void print(const std::string& s, const LabelFormatter& labelFormatter,
const ValueFormatter& valueFormatter) const override { const ValueFormatter& valueFormatter) const override {

View File

@ -127,10 +127,10 @@ namespace gtsam {
* @brief Convert from a DecisionTree<M, X> to DecisionTree<L, Y>. * @brief Convert from a DecisionTree<M, X> to DecisionTree<L, Y>.
* *
* @tparam M The previous label type. * @tparam M The previous label type.
* @tparam X The previous node type. * @tparam X The previous value type.
* @param f The node pointer to the root of the previous DecisionTree. * @param f The node pointer to the root of the previous DecisionTree.
* @param L_of_M Functor to convert from label type M to type L. * @param L_of_M Functor to convert from label type M to type L.
* @param Y_of_X Functor to convert from node type X to type Y. * @param Y_of_X Functor to convert from value type X to type Y.
* @return NodePtr * @return NodePtr
*/ */
template <typename M, typename X> template <typename M, typename X>
@ -170,22 +170,22 @@ namespace gtsam {
const DecisionTree& f0, const DecisionTree& f1); const DecisionTree& f0, const DecisionTree& f1);
/** /**
* @brief Convert from a different node type. * @brief Convert from a different value type.
* *
* @tparam X The previous node type. * @tparam X The previous value type.
* @param other The DecisionTree to convert from. * @param other The DecisionTree to convert from.
* @param Y_of_X Functor to convert from node type X to type Y. * @param Y_of_X Functor to convert from value type X to type Y.
*/ */
template <typename X> template <typename X>
DecisionTree(const DecisionTree<L, X>& other, DecisionTree(const DecisionTree<L, X>& other,
std::function<Y(const X&)> Y_of_X); std::function<Y(const X&)> Y_of_X);
/** /**
* @brief Convert from a different node type X to node type Y, also transate * @brief Convert from a different value type X to value type Y, also transate
* labels via map from type M to L. * labels via map from type M to L.
* *
* @tparam M Previous label type. * @tparam M Previous label type.
* @tparam X Previous node type. * @tparam X Previous value type.
* @param other The decision tree to convert. * @param other The decision tree to convert.
* @param L_of_M Map from label type M to type L. * @param L_of_M Map from label type M to type L.
* @param Y_of_X Functor to convert from type X to type Y. * @param Y_of_X Functor to convert from type X to type Y.
@ -286,13 +286,6 @@ namespace gtsam {
return f.apply(op); return f.apply(op);
} }
/// Apply unary operator `op` to DecisionTree `f` but with node type.
template<typename L, typename Y, typename X>
DecisionTree<L, Y> apply(const DecisionTree<L, Y>& f,
const std::function<Y(const X&)>& op) {
return f.apply(op);
}
/// Apply binary operator `op` to DecisionTree `f`. /// Apply binary operator `op` to DecisionTree `f`.
template<typename L, typename Y> template<typename L, typename Y>
DecisionTree<L, Y> apply(const DecisionTree<L, Y>& f, DecisionTree<L, Y> apply(const DecisionTree<L, Y>& f,