minimal_splits_number_sweep.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_CORE_TREE_RECTANGLE_TREE_MINIMAL_SPLITS_NUMBER_SWEEP_HPP
14 #define MLPACK_CORE_TREE_RECTANGLE_TREE_MINIMAL_SPLITS_NUMBER_SWEEP_HPP
15 
16 namespace mlpack {
17 namespace tree {
18 
30 template<typename SplitPolicy>
32 {
33  public:
35  template<typename>
36  struct SweepCost
37  {
38  typedef size_t type;
39  };
40 
49  template<typename TreeType>
50  static size_t SweepNonLeafNode(
51  const size_t axis,
52  const TreeType* node,
53  typename TreeType::ElemType& axisCut);
54 
63  template<typename TreeType>
64  static size_t SweepLeafNode(
65  const size_t axis,
66  const TreeType* node,
67  typename TreeType::ElemType& axisCut);
68 };
69 
70 } // namespace tree
71 } // namespace mlpack
72 
73 // Include implementation
74 #include "minimal_splits_number_sweep_impl.hpp"
75 
76 #endif // MLPACK_CORE_TREE_RECTANGLE_TREE_MINIMAL_SPLITS_NUMBER_SWEEP_HPP
77 
78 
Linear algebra utility functions, generally performed on matrices or vectors.
A struct that provides the type of the sweep cost.
static size_t 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.
The MinimalSplitsNumberSweep class finds a partition along which we can split a node according to the...
static size_t SweepLeafNode(const size_t axis, const TreeType *node, typename TreeType::ElemType &axisCut)
Find a suitable partition of a leaf node along the provided axis.