mlpack
r_plus_plus_tree_descent_heuristic_impl.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_CORE_TREE_RECTANGLE_TREE_RPP_TREE_DESCENT_HEURISTIC_IMPL_HPP
14 #define MLPACK_CORE_TREE_RECTANGLE_TREE_RPP_TREE_DESCENT_HEURISTIC_IMPL_HPP
15 
17 #include "../hrectbound.hpp"
18 
19 namespace mlpack {
20 namespace tree {
21 
22 template<typename TreeType>
24  TreeType* node, const size_t point)
25 {
26  // Find the node whose maximum bounding rectangle contains the point.
27  for (size_t bestIndex = 0; bestIndex < node->NumChildren(); bestIndex++)
28  {
29  if (node->Child(bestIndex).AuxiliaryInfo().OuterBound().Contains(
30  node->Dataset().col(point)))
31  return bestIndex;
32  }
33 
34  // We should never reach this point.
35  assert(false);
36 
37  return 0;
38 }
39 
40 template<typename TreeType>
42  const TreeType* /* node */, const TreeType* /* insertedNode */)
43 {
44  // Should never be used.
45  assert(false);
46 
47  return 0;
48 }
49 
50 } // namespace tree
51 } // namespace mlpack
52 
53 #endif // MLPACK_CORE_TREE_RECTANGLE_TREE_RPP_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_plus_tree_descent_heuristic_impl.hpp:23