mlpack  2.0.1
x_tree_split.hpp
Go to the documentation of this file.
1 
17 #ifndef __MLPACK_CORE_TREE_RECTANGLE_TREE_X_TREE_SPLIT_HPP
18 #define __MLPACK_CORE_TREE_RECTANGLE_TREE_X_TREE_SPLIT_HPP
19 
20 #include <mlpack/core.hpp>
21 
22 namespace mlpack {
23 namespace tree {
24 
31 const double MAX_OVERLAP = 0.2;
32 
39 {
40  public:
46  template<typename TreeType>
47  static void SplitLeafNode(TreeType* tree, std::vector<bool>& relevels);
48 
53  template<typename TreeType>
54  static bool SplitNonLeafNode(TreeType* tree, std::vector<bool>& relevels);
55 
56  private:
60  class sortStruct
61  {
62  public:
63  double d;
64  int n;
65  };
66 
70  static bool structComp(const sortStruct& s1, const sortStruct& s2)
71  {
72  return s1.d < s2.d;
73  }
74 
78  template<typename TreeType>
79  static void InsertNodeIntoTree(TreeType* destTree, TreeType* srcNode);
80 };
81 
82 } // namespace tree
83 } // namespace mlpack
84 
85 // Include implementation
86 #include "x_tree_split_impl.hpp"
87 
88 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
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...
Class to allow for faster sorting.
static bool structComp(const sortStruct &s1, const sortStruct &s2)
Comparator for sorting with sortStruct.
static void InsertNodeIntoTree(TreeType *destTree, TreeType *srcNode)
Insert a node into another node.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
A Rectangle Tree has new points inserted at the bottom.
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.