r_plus_tree_split.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_CORE_TREE_RECTANGLE_TREE_R_PLUS_TREE_SPLIT_HPP
14 #define MLPACK_CORE_TREE_RECTANGLE_TREE_R_PLUS_TREE_SPLIT_HPP
15 
16 #include <mlpack/prereqs.hpp>
17 
18 namespace mlpack {
19 namespace tree {
20 
30 template<typename SplitPolicyType,
31  template<typename> class SweepType>
33 {
34  public:
35  typedef SplitPolicyType SplitPolicy;
42  template<typename TreeType>
43  static void SplitLeafNode(TreeType* tree, std::vector<bool>& relevels);
44 
51  template<typename TreeType>
52  static bool SplitNonLeafNode(TreeType* tree, std::vector<bool>& relevels);
53 
54  private:
64  template<typename TreeType>
65  static void SplitLeafNodeAlongPartition(
66  TreeType* tree,
67  TreeType* treeOne,
68  TreeType* treeTwo,
69  const size_t cutAxis,
70  const typename TreeType::ElemType cut);
71 
82  template<typename TreeType>
83  static void SplitNonLeafNodeAlongPartition(
84  TreeType* tree,
85  TreeType* treeOne,
86  TreeType* treeTwo,
87  const size_t cutAxis,
88  const typename TreeType::ElemType cut);
89 
101  template<typename TreeType>
102  static void AddFakeNodes(const TreeType* tree, TreeType* emptyTree);
103 
116  template<typename TreeType>
117  static bool PartitionNode(const TreeType* node,
118  size_t& minCutAxis,
119  typename TreeType::ElemType& minCut);
120 
124  template<typename TreeType>
125  static void InsertNodeIntoTree(TreeType* destTree, TreeType* srcNode);
126 };
127 
128 } // namespace tree
129 } // namespace mlpack
130 
131 // Include implementation
132 #include "r_plus_tree_split_impl.hpp"
133 
134 #endif // MLPACK_CORE_TREE_RECTANGLE_TREE_R_PLUS_TREE_SPLIT_HPP
The RPlusTreeSplit class performs the split process of a node on overflow.
strip_type.hpp
Definition: add_to_po.hpp:21
static void SplitLeafNode(TreeType *tree, std::vector< bool > &relevels)
Split a leaf node using the "default" algorithm.
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 "default" algorithm.