12 #ifndef MLPACK_CORE_TREE_SPILL_TREE_PROJECTION_VECTOR_HPP 13 #define MLPACK_CORE_TREE_SPILL_TREE_PROJECTION_VECTOR_HPP 16 #include "../bounds.hpp" 44 template<
typename VecType>
57 template<
typename MetricType,
typename ElemType>
70 template<
typename MetricType,
typename VecType>
80 template<
typename Archive>
110 projVect(
arma::normalise(vect))
118 template<
typename VecType>
122 return arma::dot(point, projVect);
131 template<
typename MetricType,
typename VecType>
135 typedef typename VecType::elem_type ElemType;
137 const ElemType radius = bound.
Radius();
144 template<
typename Archive>
147 ar(CEREAL_NVP(projVect));
math::RangeType< typename VecType::elem_type > Project(const bound::BallBound< MetricType, VecType > &bound) const
Project the given ball bound on the projection vector.
Definition: projection_vector.hpp:71
double Project(const VecType &point, typename std::enable_if_t< IsVector< VecType >::value > *=0) const
Project the given point on the projection vector.
Definition: projection_vector.hpp:45
double Project(const VecType &point, typename std::enable_if_t< IsVector< VecType >::value > *=0) const
Project the given point on the projection vector.
Definition: projection_vector.hpp:119
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
ElemType Radius() const
Get the radius of the ball.
Definition: ballbound.hpp:91
math::RangeType< ElemType > Project(const bound::HRectBound< MetricType, ElemType > &bound) const
Project the given hrect bound on the projection vector.
Definition: projection_vector.hpp:58
The core includes that mlpack expects; standard C++ includes and Armadillo.
const VecType & Center() const
Get the center point of the ball.
Definition: ballbound.hpp:96
void serialize(Archive &ar, const uint32_t)
Serialization.
Definition: projection_vector.hpp:81
ProjVector defines a general projection vector (not necessarily axis-parallel).
Definition: projection_vector.hpp:91
Ball bound encloses a set of points at a specific distance (radius) from a specific point (center)...
Definition: ballbound.hpp:32
ProjVector(const arma::vec &vect)
Create the projection vector based on the specified vector.
Definition: projection_vector.hpp:109
Hyper-rectangle bound for an L-metric.
Definition: hrectbound.hpp:54
ProjVector()
Empty Constructor.
Definition: projection_vector.hpp:100
AxisParallelProjVector(size_t dim=0)
Create the projection vector based on the specified dimension.
Definition: projection_vector.hpp:35
math::RangeType< typename VecType::elem_type > Project(const bound::BallBound< MetricType, VecType > &bound) const
Project the given ball bound on the projection vector.
Definition: projection_vector.hpp:132
void serialize(Archive &ar, const uint32_t)
Serialization.
Definition: projection_vector.hpp:145
If value == true, then VecType is some sort of Armadillo vector or subview.
Definition: arma_traits.hpp:35