13 #ifndef MLPACK_CORE_TREE_RECTANGLE_TREE_R_PLUS_TREE_DESCENT_HEURISTIC_IMPL_HPP 14 #define MLPACK_CORE_TREE_RECTANGLE_TREE_R_PLUS_TREE_DESCENT_HEURISTIC_IMPL_HPP 17 #include "../hrectbound.hpp" 22 template<
typename TreeType>
26 typedef typename TreeType::ElemType ElemType;
31 for (bestIndex = 0; bestIndex < node->NumChildren(); bestIndex++)
33 if (node->Child(bestIndex).Bound().Contains(
34 node->Dataset().col(point)))
40 for (bestIndex = 0; bestIndex < node->NumChildren(); bestIndex++)
43 node->Child(bestIndex).Bound();
44 bound |= node->Dataset().col(point);
48 for (
size_t j = 0; j < node->NumChildren(); ++j)
55 for (
size_t k = 0; k < node->Bound().Dim(); ++k)
57 if (bound[k].Lo() >= node->Child(j).Bound()[k].Hi() ||
58 node->Child(j).Bound()[k].Lo() >= bound[k].Hi())
75 size_t depth = node->TreeDepth();
78 TreeType* tree = node;
81 TreeType* child =
new TreeType(tree);
83 tree->children[tree->NumChildren()++] = child;
87 return node->NumChildren() - 1;
90 assert(bestIndex < node->NumChildren());
95 template<
typename TreeType>
97 const TreeType* ,
const TreeType* )
108 #endif // MLPACK_CORE_TREE_RECTANGLE_TREE_R_PLUS_TREE_DESCENT_HEURISTIC_IMPL_HPP
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
static size_t ChooseDescentNode(TreeType *node, const size_t point)
Evaluate the node using a heuristic.
Definition: r_plus_tree_descent_heuristic_impl.hpp:23