mlpack  2.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
r_star_tree_split.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_CORE_TREE_RECTANGLE_TREE_R_STAR_TREE_SPLIT_HPP
14 #define MLPACK_CORE_TREE_RECTANGLE_TREE_R_STAR_TREE_SPLIT_HPP
15 
16 #include <mlpack/prereqs.hpp>
17 
18 namespace mlpack {
19 namespace tree {
20 
27 {
28  public:
34  template <typename TreeType>
35  static void SplitLeafNode(TreeType *tree,std::vector<bool>& relevels);
36 
41  template <typename TreeType>
42  static bool SplitNonLeafNode(TreeType *tree,std::vector<bool>& relevels);
43 
48  template<typename TreeType>
49  static size_t ReinsertPoints(TreeType* tree, std::vector<bool>& relevels);
50 
54  template<typename TreeType>
55  static void PickLeafSplit(TreeType* tree, size_t& bestAxis, size_t& bestIndex);
56 
57  private:
61  template <typename TreeType>
62  static void InsertNodeIntoTree(TreeType* destTree, TreeType* srcNode);
63 
68  template<typename ElemType, typename TreeType>
69  static bool PairComp(const std::pair<ElemType, TreeType>& p1,
70  const std::pair<ElemType, TreeType>& p2)
71  {
72  return p1.first < p2.first;
73  }
74 };
75 
76 } // namespace tree
77 } // namespace mlpack
78 
79 // Include implementation
80 #include "r_star_tree_split_impl.hpp"
81 
82 #endif
static void PickLeafSplit(TreeType *tree, size_t &bestAxis, size_t &bestIndex)
Given a node, return the best dimension and the best index to split on.
The core includes that mlpack expects; standard C++ includes and Armadillo.
static bool SplitNonLeafNode(TreeType *tree, std::vector< bool > &relevels)
Split a non-leaf node using the &quot;default&quot; algorithm.
static size_t ReinsertPoints(TreeType *tree, std::vector< bool > &relevels)
Reinsert any points into the tree, if needed.
A Rectangle Tree has new points inserted at the bottom.
static void SplitLeafNode(TreeType *tree, std::vector< bool > &relevels)
Split a leaf node using the algorithm described in "The R*-tree: An Efficient and Robust Access metho...