mlpack  2.0.1
r_star_tree_split.hpp
Go to the documentation of this file.
1 
15 #ifndef __MLPACK_CORE_TREE_RECTANGLE_TREE_R_STAR_TREE_SPLIT_HPP
16 #define __MLPACK_CORE_TREE_RECTANGLE_TREE_R_STAR_TREE_SPLIT_HPP
17 
18 #include <mlpack/core.hpp>
19 
20 namespace mlpack {
21 namespace tree {
22 
29 {
30  public:
36  template<typename TreeType>
37  static void SplitLeafNode(TreeType* tree, std::vector<bool>& relevels);
38 
43  template<typename TreeType>
44  static bool SplitNonLeafNode(TreeType* tree, std::vector<bool>& relevels);
45 
46  private:
50  struct SortStruct
51  {
52  double d;
53  int n;
54  };
55 
59  static bool StructComp(const SortStruct& s1, const SortStruct& s2)
60  {
61  return s1.d < s2.d;
62  }
63 
67  template<typename TreeType>
68  static void InsertNodeIntoTree(TreeType* destTree, TreeType* srcNode);
69 };
70 
71 } // namespace tree
72 } // namespace mlpack
73 
74 // Include implementation
75 #include "r_star_tree_split_impl.hpp"
76 
77 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
static void InsertNodeIntoTree(TreeType *destTree, TreeType *srcNode)
Insert a node into another node.
static bool SplitNonLeafNode(TreeType *tree, std::vector< bool > &relevels)
Split a non-leaf node using the "default" algorithm.
static bool StructComp(const SortStruct &s1, const SortStruct &s2)
Comparator for sorting with SortStruct.
Class to allow for faster sorting.
A Rectangle Tree has new points inserted at the bottom.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
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...