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 
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 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
prereqs.hpp
The core includes that mlpack expects; standard C++ includes and Armadillo.
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::RPlusPlusTreeAuxiliaryInformation
RPlusPlusTreeAuxiliaryInformation(RPlusPlusTreeAuxiliaryInformation &&other)
Create an auxiliary information object by moving from another node.
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::RPlusPlusTreeAuxiliaryInformation
RPlusPlusTreeAuxiliaryInformation(const TreeType *)
Construct this as an auxiliary information for the given node.
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::SplitAuxiliaryInfo
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.
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::UpdateAuxiliaryInfo
bool UpdateAuxiliaryInfo(TreeType *)
Some tree types require to propagate the information upward.
mlpack::bound::HRectBound< metric::EuclideanDistance, ElemType >
mlpack
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: add_to_cli11.hpp:21
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::HandlePointDeletion
bool HandlePointDeletion(TreeType *, const size_t)
Some tree types require to save some properties at the deletion process.
mlpack::tree::RPlusPlusTreeAuxiliaryInformation
Definition: r_plus_plus_tree_auxiliary_information.hpp:25
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::NullifyData
void NullifyData()
Nullify the auxiliary information in order to prevent an invalid free.
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::OuterBound
const BoundType & OuterBound() const
Modify the maximum bounding rectangle.
Definition: r_plus_plus_tree_auxiliary_information.hpp:149
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::RPlusPlusTreeAuxiliaryInformation
RPlusPlusTreeAuxiliaryInformation(const RPlusPlusTreeAuxiliaryInformation &other, TreeType *tree, bool=true)
Create an auxiliary information object by copying from another object.
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::serialize
void serialize(Archive &, const unsigned int)
Serialize the information.
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::OuterBound
BoundType & OuterBound()
Return the maximum bounding rectangle.
Definition: r_plus_plus_tree_auxiliary_information.hpp:146
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::HandlePointInsertion
bool HandlePointInsertion(TreeType *, const size_t)
Some tree types require to save some properties at the insertion process.
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::HandleNodeRemoval
bool HandleNodeRemoval(TreeType *, const size_t)
Some tree types require to save some properties at the deletion process.
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::RPlusPlusTreeAuxiliaryInformation
RPlusPlusTreeAuxiliaryInformation()
Construct the auxiliary information object.
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::ElemType
TreeType::ElemType ElemType
The element type held by the tree.
Definition: r_plus_plus_tree_auxiliary_information.hpp:28
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::HandleNodeInsertion
bool HandleNodeInsertion(TreeType *, TreeType *, bool)
Some tree types require to save some properties at the insertion process.
mlpack::tree::RPlusPlusTreeAuxiliaryInformation::BoundType
bound::HRectBound< metric::EuclideanDistance, ElemType > BoundType
The bound type held by the auxiliary information.
Definition: r_plus_plus_tree_auxiliary_information.hpp:30