r_plus_plus_tree_auxiliary_information.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_CORE_TREE_RECTANGLE_TREE_RPP_TREE_AUXILIARY_INFO_HPP
15 #define MLPACK_CORE_TREE_RECTANGLE_TREE_RPP_TREE_AUXILIARY_INFO_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 
151  private:
153  BoundType outerBound;
154 
155  public:
159  template<typename Archive>
160  void serialize(Archive &, const uint32_t /* version */);
161 };
162 
163 } // namespace tree
164 } // namespace mlpack
165 
166 #include "r_plus_plus_tree_auxiliary_information_impl.hpp"
167 
168 #endif // MLPACK_CORE_TREE_RECTANGLE_TREE_RPP_TREE_AUXILIARY_INFO_HPP
Linear algebra utility functions, generally performed on matrices or vectors.
bool HandleNodeRemoval(TreeType *, const size_t)
Some tree types require to save some properties at the deletion process.
The core includes that mlpack expects; standard C++ includes and Armadillo.
bool UpdateAuxiliaryInfo(TreeType *)
Some tree types require to propagate the information upward.
bool HandleNodeInsertion(TreeType *, TreeType *, bool)
Some tree types require to save some properties at the insertion process.
BoundType & OuterBound()
Return the maximum bounding rectangle.
TreeType::ElemType ElemType
The element type held by the tree.
RPlusPlusTreeAuxiliaryInformation()
Construct the auxiliary information object.
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...
bound::HRectBound< metric::EuclideanDistance, ElemType > BoundType
The bound type held by the auxiliary information.
void NullifyData()
Nullify the auxiliary information in order to prevent an invalid free.
const BoundType & OuterBound() const
Modify the maximum bounding rectangle.
void serialize(Archive &, const uint32_t)
Serialize the information.
bool HandlePointInsertion(TreeType *, const size_t)
Some tree types require to save some properties at the insertion process.
bool HandlePointDeletion(TreeType *, const size_t)
Some tree types require to save some properties at the deletion process.