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
HilbertRTreeAuxiliaryInformation()
Default constructor.
strip_type.hpp
Definition: add_to_po.hpp:21
static const std::vector< TreeType * > Children(const TreeType *tree)
Return the children vector of the tree.
bool HandlePointDeletion(TreeType *node, const size_t localIndex)
The Hilbert R tree requires all points to be arranged according to their Hilbert value.
const HilbertValueType< ElemType > & HilbertValue() const
Return the largest Hilbert value of a point covered by the node.
bool HandleNodeInsertion(TreeType *node, TreeType *nodeToInsert, bool insertionLevel)
The Hilbert R tree requires to insert nodes according to their Hilbert value.
bool HandlePointInsertion(TreeType *node, const size_t point)
The Hilbert R tree requires to insert points according to their Hilbert value.
TreeType::ElemType ElemType
The element type held by the tree.
void serialize(Archive &ar, const unsigned int)
Serialize the information.
bool UpdateAuxiliaryInfo(TreeType *node)
Update the auxiliary information in the node.
bool HandleNodeRemoval(TreeType *node, const size_t nodeIndex)
The Hilbert R tree requires all nodes to be arranged according to their Hilbert value.
HilbertRTreeAuxiliaryInformation & operator=(const HilbertRTreeAuxiliaryInformation &other)
Copy the auxiliary information.
HilbertValueType< ElemType > & HilbertValue()
Modify the largest Hilbert value of a point covered by the node.