minimal_coverage_sweep.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_CORE_TREE_RECTANGLE_TREE_MINIMAL_COVERAGE_SWEEP_HPP
14 #define MLPACK_CORE_TREE_RECTANGLE_TREE_MINIMAL_COVERAGE_SWEEP_HPP
15 
16 namespace mlpack {
17 namespace tree {
18 
29 template<typename SplitPolicy>
31 {
32  public:
34  template<typename TreeType>
35  struct SweepCost
36  {
37  typedef typename TreeType::ElemType type;
38  };
39 
48  template<typename TreeType>
49  static typename TreeType::ElemType SweepNonLeafNode(
50  const size_t axis,
51  const TreeType* node,
52  typename TreeType::ElemType& axisCut);
53 
62  template<typename TreeType>
63  static typename TreeType::ElemType SweepLeafNode(
64  const size_t axis,
65  const TreeType* node,
66  typename TreeType::ElemType& axisCut);
67 
76  template<typename TreeType, typename ElemType>
77  static bool CheckNonLeafSweep(const TreeType* node,
78  const size_t cutAxis,
79  const ElemType cut);
80 
89  template<typename TreeType, typename ElemType>
90  static bool CheckLeafSweep(const TreeType* node,
91  const size_t cutAxis,
92  const ElemType cut);
93 };
94 
95 } // namespace tree
96 } // namespace mlpack
97 
98 // Include implementation
99 #include "minimal_coverage_sweep_impl.hpp"
100 
101 #endif // MLPACK_CORE_TREE_RECTANGLE_TREE_MINIMAL_COVERAGE_SWEEP_HPP
102 
static TreeType::ElemType SweepNonLeafNode(const size_t axis, const TreeType *node, typename TreeType::ElemType &axisCut)
Find a suitable partition of a non-leaf node along the provided axis.
A struct that provides the type of the sweep cost.
.hpp
Definition: add_to_po.hpp:21
static bool CheckNonLeafSweep(const TreeType *node, const size_t cutAxis, const ElemType cut)
Check if an intermediate node can be split along the axis at the provided coordinate.
static TreeType::ElemType SweepLeafNode(const size_t axis, const TreeType *node, typename TreeType::ElemType &axisCut)
Find a suitable partition of a leaf node along the provided axis.
The MinimalCoverageSweep class finds a partition along which we can split a node according to the cov...
static bool CheckLeafSweep(const TreeType *node, const size_t cutAxis, const ElemType cut)
Check if a leaf node can be split along the axis at the provided coordinate.