From 383439efcf500ea94219c70344e2ebcdb68d1b7c Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Sat, 31 Dec 2022 12:25:17 +0100 Subject: [PATCH] make DecisionTree docstrings clearer --- gtsam/discrete/DecisionTree.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtsam/discrete/DecisionTree.h b/gtsam/discrete/DecisionTree.h index 957a4eb48..01a57637f 100644 --- a/gtsam/discrete/DecisionTree.h +++ b/gtsam/discrete/DecisionTree.h @@ -236,7 +236,7 @@ namespace gtsam { /** * @brief Visit all leaves in depth-first fashion. * - * @param f (side-effect) Function taking a value. + * @param f (side-effect) Function taking the value of the leaf node. * * @note Due to pruning, the number of leaves may not be the same as the * number of assignments. E.g. if we have a tree on 2 binary variables with @@ -245,7 +245,7 @@ namespace gtsam { * Example: * int sum = 0; * auto visitor = [&](int y) { sum += y; }; - * tree.visitWith(visitor); + * tree.visit(visitor); */ template void visit(Func f) const; @@ -261,8 +261,8 @@ namespace gtsam { * * Example: * int sum = 0; - * auto visitor = [&](int y) { sum += y; }; - * tree.visitWith(visitor); + * auto visitor = [&](const Leaf& leaf) { sum += leaf.constant(); }; + * tree.visitLeaf(visitor); */ template void visitLeaf(Func f) const;