13 #ifndef MLPACK_CORE_TREE_ENUMERATE_TREE_HPP 14 #define MLPACK_CORE_TREE_ENUMERATE_TREE_HPP 23 template <
class TreeType,
class Walker>
27 walker.Enter(tree, (
const TreeType*)
nullptr);
29 const size_t numChildren = tree->NumChildren();
30 for (
size_t i = 0; i < numChildren; ++i)
32 TreeType* child = tree->ChildPtr(i);
33 walker.Enter(child, tree);
35 walker.Leave(child, tree);
39 walker.Leave(tree, (
const TreeType*)
nullptr);
55 template <
class TreeType,
class Walker>
65 #endif // MLPACK_CORE_TREE_ENUMERATE_TREE_HPP Linear algebra utility functions, generally performed on matrices or vectors.
void EnumerateTreeImpl(TreeType *tree, Walker &walker, bool root)
void EnumerateTree(TreeType *tree, Walker &walker)
Traverses all nodes of the tree, including the inner ones.