mlpack  3.4.2
hilbert_r_tree_auxiliary_information.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_CORE_TREE_RECTANGLE_TREE_HR_TREE_AUXILIARY_INFO_HPP
15 #define MLPACK_CORE_TREE_RECTANGLE_TREE_HR_TREE_AUXILIARY_INFO_HPP
16 
17 namespace mlpack {
18 namespace tree {
19 
20 template<typename TreeType,
21  template<typename> class HilbertValueType>
23 {
24  public:
26  typedef typename TreeType::ElemType ElemType;
29 
35  HilbertRTreeAuxiliaryInformation(const TreeType* node);
36 
48  TreeType* tree = NULL,
49  bool deepCopy = true);
50 
57 
65 
74  bool HandlePointInsertion(TreeType* node, const size_t point);
75 
86  bool HandleNodeInsertion(TreeType* node,
87  TreeType* nodeToInsert,
88  bool insertionLevel);
89 
99  bool HandlePointDeletion(TreeType* node, const size_t localIndex);
100 
110  bool HandleNodeRemoval(TreeType* node, const size_t nodeIndex);
111 
118  bool UpdateAuxiliaryInfo(TreeType* node);
119 
121  void NullifyData();
122 
124  static const std::vector<TreeType*> Children(const TreeType* tree)
125  { return tree->children; }
126 
127  private:
129  HilbertValueType<ElemType> hilbertValue;
130 
131  public:
133  const HilbertValueType<ElemType>& HilbertValue() const
134  { return hilbertValue; }
136  HilbertValueType<ElemType>& HilbertValue() { return hilbertValue; }
137 
141  template<typename Archive>
142  void serialize(Archive& ar, const unsigned int /* version */);
143 };
144 
145 } // namespace tree
146 } // namespace mlpack
147 
148 #include "hilbert_r_tree_auxiliary_information_impl.hpp"
149 
150 #endif // MLPACK_CORE_TREE_RECTANGLE_TREE_HR_TREE_AUXILIARY_INFO_HPP
mlpack::tree::HilbertRTreeAuxiliaryInformation::HandleNodeInsertion
bool HandleNodeInsertion(TreeType *node, TreeType *nodeToInsert, bool insertionLevel)
The Hilbert R tree requires to insert nodes according to their Hilbert value.
mlpack::tree::HilbertRTreeAuxiliaryInformation::ElemType
TreeType::ElemType ElemType
The element type held by the tree.
Definition: hilbert_r_tree_auxiliary_information.hpp:26
mlpack::tree::HilbertRTreeAuxiliaryInformation::operator=
HilbertRTreeAuxiliaryInformation & operator=(const HilbertRTreeAuxiliaryInformation &other)
Copy the auxiliary information.
mlpack::tree::HilbertRTreeAuxiliaryInformation::Children
static const std::vector< TreeType * > Children(const TreeType *tree)
Return the children vector of the tree.
Definition: hilbert_r_tree_auxiliary_information.hpp:124
mlpack::tree::HilbertRTreeAuxiliaryInformation::HilbertRTreeAuxiliaryInformation
HilbertRTreeAuxiliaryInformation()
Default constructor.
mlpack::tree::HilbertRTreeAuxiliaryInformation::HilbertValue
HilbertValueType< ElemType > & HilbertValue()
Modify the largest Hilbert value of a point covered by the node.
Definition: hilbert_r_tree_auxiliary_information.hpp:136
mlpack::tree::HilbertRTreeAuxiliaryInformation::HilbertRTreeAuxiliaryInformation
HilbertRTreeAuxiliaryInformation(HilbertRTreeAuxiliaryInformation &&other)
Create an auxiliary information object by moving from the other node.
mlpack::tree::HilbertRTreeAuxiliaryInformation::serialize
void serialize(Archive &ar, const unsigned int)
Serialize the information.
mlpack::tree::HilbertRTreeAuxiliaryInformation::HandlePointInsertion
bool HandlePointInsertion(TreeType *node, const size_t point)
The Hilbert R tree requires to insert points according to their Hilbert value.
mlpack::tree::HilbertRTreeAuxiliaryInformation::HilbertRTreeAuxiliaryInformation
HilbertRTreeAuxiliaryInformation(const HilbertRTreeAuxiliaryInformation &other, TreeType *tree=NULL, bool deepCopy=true)
Create an auxiliary information object by copying from another object.
mlpack::tree::HilbertRTreeAuxiliaryInformation::HandlePointDeletion
bool HandlePointDeletion(TreeType *node, const size_t localIndex)
The Hilbert R tree requires all points to be arranged according to their Hilbert value.
mlpack
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: add_to_cli11.hpp:21
mlpack::tree::HilbertRTreeAuxiliaryInformation::HilbertValue
const HilbertValueType< ElemType > & HilbertValue() const
Return the largest Hilbert value of a point covered by the node.
Definition: hilbert_r_tree_auxiliary_information.hpp:133
mlpack::tree::HilbertRTreeAuxiliaryInformation::HilbertRTreeAuxiliaryInformation
HilbertRTreeAuxiliaryInformation(const TreeType *node)
Construct this as an auxiliary information for the given node.
mlpack::tree::HilbertRTreeAuxiliaryInformation::UpdateAuxiliaryInfo
bool UpdateAuxiliaryInfo(TreeType *node)
Update the auxiliary information in the node.
mlpack::tree::HilbertRTreeAuxiliaryInformation
Definition: hilbert_r_tree_auxiliary_information.hpp:23
mlpack::tree::HilbertRTreeAuxiliaryInformation::HandleNodeRemoval
bool HandleNodeRemoval(TreeType *node, const size_t nodeIndex)
The Hilbert R tree requires all nodes to be arranged according to their Hilbert value.
mlpack::tree::HilbertRTreeAuxiliaryInformation::NullifyData
void NullifyData()
Clear memory.