mlpack 3.4.2
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
20namespace mlpack {
21namespace tree {
22
23template<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
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 unsigned int /* 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
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.
RPlusPlusTreeAuxiliaryInformation(const TreeType *)
Construct this as an auxiliary information for the given node.
bool UpdateAuxiliaryInfo(TreeType *)
Some tree types require to propagate the information upward.
bool HandlePointDeletion(TreeType *, const size_t)
Some tree types require to save some properties at the deletion process.
bool HandleNodeInsertion(TreeType *, TreeType *, bool)
Some tree types require to save some properties at the insertion process.
bound::HRectBound< metric::EuclideanDistance, ElemType > BoundType
The bound type held by the auxiliary information.
bool HandleNodeRemoval(TreeType *, const size_t)
Some tree types require to save some properties at the deletion process.
RPlusPlusTreeAuxiliaryInformation()
Construct the auxiliary information object.
const BoundType & OuterBound() const
Modify the maximum bounding rectangle.
RPlusPlusTreeAuxiliaryInformation(const RPlusPlusTreeAuxiliaryInformation &other, TreeType *tree, bool=true)
Create an auxiliary information object by copying from another object.
void NullifyData()
Nullify the auxiliary information in order to prevent an invalid free.
RPlusPlusTreeAuxiliaryInformation(RPlusPlusTreeAuxiliaryInformation &&other)
Create an auxiliary information object by moving from another node.
TreeType::ElemType ElemType
The element type held by the tree.
void serialize(Archive &, const unsigned int)
Serialize the information.
BoundType & OuterBound()
Return the maximum bounding rectangle.
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: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.