12 #ifndef MLPACK_CORE_TREE_SPILL_TREE_HYPERPLANE_HPP 13 #define MLPACK_CORE_TREE_SPILL_TREE_HYPERPLANE_HPP 29 template<
typename BoundT,
typename ProjVectorT>
40 ProjVectorType projVect;
70 template<
typename VecType>
74 if (splitVal == DBL_MAX)
76 return projVect.Project(point) - splitVal;
85 template<
typename VecType>
86 bool Left(
const VecType& point,
98 template<
typename VecType>
99 bool Right(
const VecType& point,
110 bool Left(
const BoundType& bound)
const 112 if (splitVal == DBL_MAX)
114 return projVect.Project(bound).Hi() <= splitVal;
122 bool Right(
const BoundType& bound)
const 124 if (splitVal == DBL_MAX)
126 return projVect.Project(bound).Lo() > splitVal;
132 template<
typename Archive>
135 ar(CEREAL_NVP(projVect));
136 ar(CEREAL_NVP(splitVal));
143 template<
typename MetricType>
150 template<
typename MetricType>
double Project(const VecType &point, typename std::enable_if_t< IsVector< VecType >::value > *=0) const
Project the given point on the projection vector and subtract the split value.
Definition: hyperplane.hpp:71
HyperplaneBase()
Empty Constructor.
Definition: hyperplane.hpp:49
AxisParallelProjVector defines an axis-parallel projection vector.
Definition: projection_vector.hpp:24
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.
bool Left(const VecType &point, typename std::enable_if_t< IsVector< VecType >::value > *=0) const
Determine if the given point is to the left of the hyperplane, this means if the projection over the ...
Definition: hyperplane.hpp:86
HyperplaneBase defines a splitting hyperplane based on a projection vector and projection value...
Definition: hyperplane.hpp:30
ProjVector defines a general projection vector (not necessarily axis-parallel).
Definition: projection_vector.hpp:91
void serialize(Archive &ar, const uint32_t)
Serialization.
Definition: hyperplane.hpp:133
HyperplaneBase(const ProjVectorType &projVect, double splitVal)
Create the hyperplane with the specified projection vector and split value.
Definition: hyperplane.hpp:59
BoundT BoundType
Useful typedef for the bound type.
Definition: hyperplane.hpp:34
ProjVectorT ProjVectorType
Useful typedef for the projection vector type.
Definition: hyperplane.hpp:36
bool Right(const BoundType &bound) const
Determine if the given bound is to the right of the hyperplane.
Definition: hyperplane.hpp:122
bool Right(const VecType &point, typename std::enable_if_t< IsVector< VecType >::value > *=0) const
Determine if the given point is to the right of the hyperplane, this means if the projection over the...
Definition: hyperplane.hpp:99
bool Left(const BoundType &bound) const
Determine if the given bound is to the left of the hyperplane.
Definition: hyperplane.hpp:110
If value == true, then VecType is some sort of Armadillo vector or subview.
Definition: arma_traits.hpp:35