mlpack  master
r_plus_plus_tree_auxiliary_information.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_CORE_TREE_RECTANGLE_TREE_R_PLUS_PLUS_TREE_AUXILIARY_INFORMATION_HPP
15 #define MLPACK_CORE_TREE_RECTANGLE_TREE_R_PLUS_PLUS_TREE_AUXILIARY_INFORMATION_HPP
16 
17 #include <mlpack/prereqs.hpp>
18 #include "../hrectbound.hpp"
19 
20 namespace mlpack {
21 namespace tree {
22 
23 template<typename TreeType>
25 {
26  public:
28  typedef typename TreeType::ElemType ElemType;
31 
34 
40  RPlusPlusTreeAuxiliaryInformation(const TreeType* /* node */);
41 
53  TreeType* tree,
54  bool /* deepCopy */ = true);
55 
63 
74  bool HandlePointInsertion(TreeType* /* node */, const size_t /* point */);
75 
88  bool HandleNodeInsertion(TreeType* /* node */,
89  TreeType* /* nodeToInsert */,
90  bool /* insertionLevel */);
91 
102  bool HandlePointDeletion(TreeType* /* node */, const size_t /* localIndex */);
103 
114  bool HandleNodeRemoval(TreeType* /* node */, const size_t /* nodeIndex */);
115 
116 
124  bool UpdateAuxiliaryInfo(TreeType* /* node */);
125 
135  void SplitAuxiliaryInfo(TreeType* treeOne,
136  TreeType* treeTwo,
137  const size_t axis,
138  const ElemType cut);
139 
143  void NullifyData();
144 
146  BoundType& OuterBound() { return outerBound; }
147 
149  const BoundType& OuterBound() const { return outerBound; }
150  private:
152  BoundType outerBound;
153  public:
157  template<typename Archive>
158  void Serialize(Archive &, const unsigned int /* version */);
159 };
160 
161 } // namespace tree
162 } // namespace mlpack
163 
164 #include "r_plus_plus_tree_auxiliary_information_impl.hpp"
165 
166 #endif//MLPACK_CORE_TREE_RECTANGLE_TREE_R_PLUS_PLUS_TREE_AUXILIARY_INFORMATION_HPP
bool HandleNodeRemoval(TreeType *, const size_t)
Some tree types require to save some properties at the deletion process.
bool HandlePointInsertion(TreeType *, const size_t)
Some tree types require to save some properties at the insertion process.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: binarize.hpp:18
bool HandleNodeInsertion(TreeType *, TreeType *, bool)
Some tree types require to save some properties at the insertion process.
void NullifyData()
Nullify the auxiliary information in order to prevent an invalid free.
void Serialize(Archive &, const unsigned int)
Serialize the information.
The core includes that mlpack expects; standard C++ includes and Armadillo.
const BoundType & OuterBound() const
Modify the maximum bounding rectangle.
bound::HRectBound< metric::EuclideanDistance, ElemType > BoundType
The bound type held by the auxiliary information.
void SplitAuxiliaryInfo(TreeType *treeOne, TreeType *treeTwo, const size_t axis, const ElemType cut)
The R++ tree requires to split the maximum bounding rectangle of a node that is being split...
TreeType::ElemType ElemType
The element type held by the tree.
bool UpdateAuxiliaryInfo(TreeType *)
Some tree types require to propagate the information upward.
BoundType & OuterBound()
Return the maximum bounding rectangle.
RPlusPlusTreeAuxiliaryInformation()
Construct the auxiliary information object.
bool HandlePointDeletion(TreeType *, const size_t)
Some tree types require to save some properties at the deletion process.