mlpack  2.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
traits.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_CORE_TREE_BINARY_SPACE_TREE_TRAITS_HPP
13 #define MLPACK_CORE_TREE_BINARY_SPACE_TREE_TRAITS_HPP
14 
17 
18 namespace mlpack {
19 namespace tree {
20 
27 template<typename MetricType,
28  typename StatisticType,
29  typename MatType,
30  template<typename BoundMetricType, typename...> class BoundType,
31  template<typename SplitBoundType, typename SplitMatType>
32  class SplitType>
33 class TreeTraits<BinarySpaceTree<MetricType, StatisticType, MatType, BoundType, SplitType>>
34 {
35  public:
41  static const bool HasOverlappingChildren = false;
42 
46  static const bool HasDuplicatedPoints = false;
47 
51  static const bool FirstPointIsCentroid = false;
52 
56  static const bool HasSelfChildren = false;
57 
61  static const bool RearrangesDataset = true;
62 
66  static const bool BinaryTree = true;
67 
72  static const bool UniqueNumDescendants = true;
73 };
74 
80 template<typename MetricType,
81  typename StatisticType,
82  typename MatType,
83  template<typename BoundMetricType, typename...> class BoundType>
84 class TreeTraits<BinarySpaceTree<MetricType, StatisticType, MatType, BoundType,
86 {
87  public:
91  static const bool HasOverlappingChildren = true;
92 
96  static const bool HasDuplicatedPoints = false;
97 
101  static const bool FirstPointIsCentroid = false;
102 
106  static const bool HasSelfChildren = false;
107 
111  static const bool RearrangesDataset = true;
112 
116  static const bool BinaryTree = true;
117 
122  static const bool UniqueNumDescendants = true;
123 };
124 
130 template<typename MetricType,
131  typename StatisticType,
132  typename MatType,
133  template<typename BoundMetricType, typename...> class BoundType>
134 class TreeTraits<BinarySpaceTree<MetricType, StatisticType, MatType, BoundType,
136 {
137  public:
141  static const bool HasOverlappingChildren = true;
142 
146  static const bool HasDuplicatedPoints = false;
147 
151  static const bool FirstPointIsCentroid = false;
152 
156  static const bool HasSelfChildren = false;
157 
161  static const bool RearrangesDataset = true;
162 
166  static const bool BinaryTree = true;
167 
172  static const bool UniqueNumDescendants = true;
173 };
174 
181 template<typename MetricType,
182  typename StatisticType,
183  typename MatType,
184  template<typename SplitBoundType, typename SplitMatType>
185  class SplitType>
186 class TreeTraits<BinarySpaceTree<MetricType, StatisticType, MatType,
187  bound::BallBound, SplitType>>
188 {
189  public:
190  static const bool HasOverlappingChildren = true;
191  static const bool HasDuplicatedPoints = false;
192  static const bool FirstPointIsCentroid = false;
193  static const bool HasSelfChildren = false;
194  static const bool RearrangesDataset = true;
195  static const bool BinaryTree = true;
196  static const bool UniqueNumDescendants = true;
197 };
198 
205 template<typename MetricType,
206  typename StatisticType,
207  typename MatType,
208  template<typename SplitBoundType, typename SplitMatType>
209  class SplitType>
210 class TreeTraits<BinarySpaceTree<MetricType, StatisticType, MatType,
211  bound::HollowBallBound, SplitType>>
212 {
213  public:
214  static const bool HasOverlappingChildren = true;
215  static const bool HasDuplicatedPoints = false;
216  static const bool FirstPointIsCentroid = false;
217  static const bool HasSelfChildren = false;
218  static const bool RearrangesDataset = true;
219  static const bool BinaryTree = true;
220  static const bool UniqueNumDescendants = true;
221 };
222 
229 template<typename MetricType,
230  typename StatisticType,
231  typename MatType,
232  template<typename SplitBoundType, typename SplitMatType>
233  class SplitType>
234 class TreeTraits<BinarySpaceTree<MetricType, StatisticType, MatType,
235  bound::CellBound, SplitType>>
236 {
237  public:
238  static const bool HasOverlappingChildren = true;
239  static const bool HasDuplicatedPoints = false;
240  static const bool FirstPointIsCentroid = false;
241  static const bool HasSelfChildren = false;
242  static const bool RearrangesDataset = true;
243  static const bool BinaryTree = true;
244  static const bool UniqueNumDescendants = true;
245 };
246 
247 } // namespace tree
248 } // namespace mlpack
249 
250 #endif
static const bool BinaryTree
This is true if the tree always has only two children.
This class splits a node by a random hyperplane.
A binary space partitioning tree, such as a KD-tree or a ball tree.
static const bool HasSelfChildren
This is true if the points contained in the first child of a node (Child(0)) are also contained in th...
static const bool RearrangesDataset
This is true if the tree rearranges points in the dataset when it is built.
static const bool HasDuplicatedPoints
This is true if a point can be included in more than one node.
Definition: tree_traits.hpp:89
This class splits a binary space tree.
static const bool FirstPointIsCentroid
This is true if the first point of each node is the centroid of its bound.
Definition: tree_traits.hpp:94
Bounds that are useful for binary space partitioning trees.
The TreeTraits class provides compile-time information on the characteristics of a given tree type...
Definition: tree_traits.hpp:77
static const bool HasOverlappingChildren
This is true if the subspaces represented by the children of a node can overlap.
Definition: tree_traits.hpp:84
static const bool UniqueNumDescendants
This is true if the NumDescendants() method doesn&#39;t include duplicated points.