mlpack  master
x_tree_split.hpp
Go to the documentation of this file.
1 
15 #ifndef MLPACK_CORE_TREE_RECTANGLE_TREE_X_TREE_SPLIT_HPP
16 #define MLPACK_CORE_TREE_RECTANGLE_TREE_X_TREE_SPLIT_HPP
17 
18 #include <mlpack/prereqs.hpp>
19 
20 namespace mlpack {
21 namespace tree {
22 
29 const double MAX_OVERLAP = 0.2;
30 
37 {
38  public:
44  template<typename TreeType>
45  static void SplitLeafNode(TreeType *tree,std::vector<bool>& relevels);
46 
51  template<typename TreeType>
52  static bool SplitNonLeafNode(TreeType *tree,std::vector<bool>& relevels);
53 
54  private:
58  template<typename TreeType>
59  static void InsertNodeIntoTree(TreeType* destTree, TreeType* srcNode);
60 
65  template<typename ElemType>
66  static bool PairComp(const std::pair<ElemType, size_t>& p1,
67  const std::pair<ElemType, size_t>& p2)
68  {
69  return p1.first < p2.first;
70  }
71 
72 };
73 
74 } // namespace tree
75 } // namespace mlpack
76 
77 // Include implementation
78 #include "x_tree_split_impl.hpp"
79 
80 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: binarize.hpp:18
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...
The core includes that mlpack expects; standard C++ includes and Armadillo.
static void InsertNodeIntoTree(TreeType *destTree, TreeType *srcNode)
Insert a node into another node.
A Rectangle Tree has new points inserted at the bottom.
static bool PairComp(const std::pair< ElemType, size_t > &p1, const std::pair< ElemType, size_t > &p2)
Comparator for sorting with std::pair.
static bool SplitNonLeafNode(TreeType *tree, std::vector< bool > &relevels)
Split a non-leaf node using the "default" algorithm.
const double MAX_OVERLAP
The X-tree paper says that a maximum allowable overlap of 20% works well.