mlpack
midpoint_space_split_impl.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_CORE_TREE_SPILL_TREE_MIDPOINT_SPACE_SPLIT_IMPL_HPP
14 #define MLPACK_CORE_TREE_SPILL_TREE_MIDPOINT_SPACE_SPLIT_IMPL_HPP
15 
16 #include "midpoint_space_split.hpp"
17 #include "space_split.hpp"
18 
19 namespace mlpack {
20 namespace tree {
21 
22 template<typename MetricType, typename MatType>
23 template<typename HyperplaneType>
25  const typename HyperplaneType::BoundType& bound,
26  const MatType& data,
27  const arma::Col<size_t>& points,
28  HyperplaneType& hyp)
29 {
30  typename HyperplaneType::ProjVectorType projVector;
31  double midValue;
32 
33  if (!SpaceSplit<MetricType, MatType>::GetProjVector(bound, data, points,
34  projVector, midValue))
35  return false;
36 
37  hyp = HyperplaneType(projVector, midValue);
38 
39  return true;
40 }
41 
42 } // namespace tree
43 } // namespace mlpack
44 
45 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
static bool SplitSpace(const typename HyperplaneType::BoundType &bound, const MatType &data, const arma::Col< size_t > &points, HyperplaneType &hyp)
Create a splitting hyperplane considering the midpoint of the values in a certain projection...
Definition: midpoint_space_split_impl.hpp:24
Definition: space_split.hpp:23