mlpack  master
Public Types | Public Member Functions | Private Attributes | List of all members
mlpack::tree::HyperplaneBase< BoundT, ProjVectorT > Class Template Reference

HyperplaneBase defines a splitting hyperplane based on a projection vector and projection value. More...

Public Types

typedef BoundT BoundType
 Useful typedef for the bound type. More...
 
typedef ProjVectorT ProjVectorType
 Useful typedef for the projection vector type. More...
 

Public Member Functions

 HyperplaneBase ()
 Empty Constructor. More...
 
 HyperplaneBase (const ProjVectorType &projVect, double splitVal)
 Create the hyperplane with the specified projection vector and split value. More...
 
template<typename VecType >
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 projection vector is negative or zero. More...
 
bool Left (const BoundType &bound) const
 Determine if the given bound is to the left of the hyperplane. More...
 
template<typename VecType >
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. More...
 
template<typename VecType >
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 projection vector is positive. More...
 
bool Right (const BoundType &bound) const
 Determine if the given bound is to the right of the hyperplane. More...
 
template<typename Archive >
void Serialize (Archive &ar, const unsigned int)
 Serialization. More...
 

Private Attributes

ProjVectorType projVect
 Projection vector. More...
 
double splitVal
 Projection value that determines the decision boundary. More...
 

Detailed Description

template<typename BoundT, typename ProjVectorT>
class mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >

HyperplaneBase defines a splitting hyperplane based on a projection vector and projection value.

Template Parameters
BoundTThe bound type considered.
ProjVectorTType of projection vector (AxisParallelProjVector, ProjVector).

Definition at line 30 of file hyperplane.hpp.

Member Typedef Documentation

template<typename BoundT, typename ProjVectorT>
typedef BoundT mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::BoundType

Useful typedef for the bound type.

Definition at line 34 of file hyperplane.hpp.

template<typename BoundT, typename ProjVectorT>
typedef ProjVectorT mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::ProjVectorType

Useful typedef for the projection vector type.

Definition at line 36 of file hyperplane.hpp.

Constructor & Destructor Documentation

template<typename BoundT, typename ProjVectorT>
mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::HyperplaneBase ( )
inline

Empty Constructor.

By default will consider all points to the left.

Definition at line 49 of file hyperplane.hpp.

template<typename BoundT, typename ProjVectorT>
mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::HyperplaneBase ( const ProjVectorType projVect,
double  splitVal 
)
inline

Create the hyperplane with the specified projection vector and split value.

Parameters
projVectProjection vector.
splitValSplit value.

Definition at line 59 of file hyperplane.hpp.

Member Function Documentation

template<typename BoundT, typename ProjVectorT>
template<typename VecType >
bool mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::Left ( const VecType &  point,
typename std::enable_if_t< IsVector< VecType >::value > *  = 0 
) const
inline

Determine if the given point is to the left of the hyperplane, this means if the projection over the projection vector is negative or zero.

Parameters
pointPoint to be analyzed.

Definition at line 86 of file hyperplane.hpp.

References mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::Project().

template<typename BoundT, typename ProjVectorT>
bool mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::Left ( const BoundType bound) const
inline

Determine if the given bound is to the left of the hyperplane.

Parameters
pointBound to be analyzed.

Definition at line 110 of file hyperplane.hpp.

References mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::splitVal.

template<typename BoundT, typename ProjVectorT>
template<typename VecType >
double mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::Project ( const VecType &  point,
typename std::enable_if_t< IsVector< VecType >::value > *  = 0 
) const
inline

Project the given point on the projection vector and subtract the split value.

Parameters
pointPoint to be projected.

Definition at line 71 of file hyperplane.hpp.

References mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::splitVal.

Referenced by mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::Left(), and mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::Right().

template<typename BoundT, typename ProjVectorT>
template<typename VecType >
bool mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::Right ( const VecType &  point,
typename std::enable_if_t< IsVector< VecType >::value > *  = 0 
) const
inline

Determine if the given point is to the right of the hyperplane, this means if the projection over the projection vector is positive.

Parameters
pointPoint to be analyzed.

Definition at line 99 of file hyperplane.hpp.

References mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::Project().

template<typename BoundT, typename ProjVectorT>
bool mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::Right ( const BoundType bound) const
inline

Determine if the given bound is to the right of the hyperplane.

Parameters
pointBound to be analyzed.

Definition at line 122 of file hyperplane.hpp.

References mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::splitVal.

template<typename BoundT, typename ProjVectorT>
template<typename Archive >
void mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::Serialize ( Archive &  ar,
const unsigned  int 
)
inline

Serialization.

Definition at line 133 of file hyperplane.hpp.

References mlpack::data::CreateNVP().

Member Data Documentation

template<typename BoundT, typename ProjVectorT>
ProjVectorType mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::projVect
private

Projection vector.

Definition at line 40 of file hyperplane.hpp.

template<typename BoundT, typename ProjVectorT>
double mlpack::tree::HyperplaneBase< BoundT, ProjVectorT >::splitVal
private

The documentation for this class was generated from the following file: