mlpack
hilbert_r_tree_descent_heuristic_impl.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_CORE_TREE_RECTANGLE_TREE_HR_TREE_DESCENT_HEURISTIC_IMPL_HPP
14 #define MLPACK_CORE_TREE_RECTANGLE_TREE_HR_TREE_DESCENT_HEURISTIC_IMPL_HPP
15 
17 
18 namespace mlpack {
19 namespace tree {
20 
21 template<typename TreeType>
23  const TreeType* node,
24  const size_t point)
25 {
26  size_t bestIndex = 0;
27 
28  for (bestIndex = 0; bestIndex < node->NumChildren() - 1; bestIndex++)
29  if (node->Child(bestIndex).AuxiliaryInfo().HilbertValue().
30  CompareWithCachedPoint(node->Dataset().col(point)) > 0)
31  break;
32 
33  return bestIndex;
34 }
35 
36 template<typename TreeType>
38  const TreeType* node,
39  const TreeType* /* insertedNode */)
40 {
41  size_t bestIndex = 0;
42 
43  for (bestIndex = 0; bestIndex < node->NumChildren() - 1; bestIndex++)
44  if (node->Child(bestIndex).AuxiliaryInfo().HilbertValue().
45  CompareWith(node, node->AuxiliaryInfo().HilbertValue()) > 0)
46  break;
47 
48  return bestIndex;
49 }
50 
51 } // namespace tree
52 } // namespace mlpack
53 
54 #endif // MLPACK_CORE_TREE_RECTANGLE_TREE_HR_TREE_DESCENT_HEURISTIC_IMPL_HPP
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
static size_t ChooseDescentNode(const TreeType *node, const size_t point)
Evaluate the node using a heuristic.
Definition: hilbert_r_tree_descent_heuristic_impl.hpp:22