cheshirekow  v0.1.0
mpblocks::dubins::kd_tree::KNearest< Scalar > Class Template Reference

#include <mpblocks/dubins/kd_tree/KNearest.h>

Inheritance diagram for mpblocks::dubins::kd_tree::KNearest< Scalar >:
mpblocks::kd_tree::NearestSearchIface< Traits< Scalar > >

Public Types

typedef Distance< Scalar > Distance_t
 
typedef Traits< Scalar >::HyperRect HyperRect_t
 
typedef Key< Scalar > Key_t
 
typedef Key_t::LessThan KeyCompare
 
typedef std::vector< Key_tKeyVec
 
typedef Traits< Scalar >::Node Node_t
 
typedef Eigen::Matrix< Scalar, 3, 1 > Point
 
typedef std::priority_queue
< Key_t, KeyVec, KeyCompare
PQueue_t
 
- Public Types inherited from mpblocks::kd_tree::NearestSearchIface< Traits< Scalar > >
typedef Traits< Scalar >::Format_t Format_t
 
typedef Traits< Scalar >::HyperRect HyperRect_t
 
typedef Traits< Scalar >::Node Node_t
 
typedef Vector_t Point_t
 
typedef Eigen::Matrix
< Format_t, Traits< Scalar >
::NDim, 1 > 
Vector_t
 

Public Member Functions

virtual void evaluate (const Point &q, const Point &p, Node_t *n)
 calculates Euclidean distance from q to p, and if its less than the current best replaces the current best node with n More...
 
 KNearest (unsigned int k=1, Scalar radius=1)
 
void reset ()
 
void reset (int k, Scalar radius)
 
PQueue_tresult ()
 
virtual bool shouldRecurse (const Point &q, const HyperRect_t &r)
 evaluate the Euclidean distance from q to it's closest point in r and if that distance is less than the current best distance, return true More...
 
virtual ~KNearest ()
 
- Public Member Functions inherited from mpblocks::kd_tree::NearestSearchIface< Traits< Scalar > >
virtual void evaluate (const Point_t &q, const Point_t &p, Node_t *n)=0
 evaluate the current point, and add the corresponding node to the result set if necessary More...
 
virtual bool shouldRecurse (const Point_t &q, const HyperRect_t &h)=0
 evaluate the hyper rectangle and return true if it is possible that we must recurse into it More...
 
virtual ~NearestSearchIface ()
 just ensure virtualness More...
 

Public Attributes

unsigned int m_boxesEvaluated
 
unsigned int m_nodesEvaluated
 

Protected Attributes

unsigned int m_k
 
PQueue_t m_queue
 
Scalar m_radius
 

Detailed Description

template<typename Scalar>
class mpblocks::dubins::kd_tree::KNearest< Scalar >

Definition at line 39 of file KNearest.h.

Member Typedef Documentation

template<typename Scalar >
typedef Distance<Scalar> mpblocks::dubins::kd_tree::KNearest< Scalar >::Distance_t

Definition at line 46 of file KNearest.h.

template<typename Scalar >
typedef Traits<Scalar>::HyperRect mpblocks::dubins::kd_tree::KNearest< Scalar >::HyperRect_t

Definition at line 44 of file KNearest.h.

template<typename Scalar >
typedef Key<Scalar> mpblocks::dubins::kd_tree::KNearest< Scalar >::Key_t

Definition at line 47 of file KNearest.h.

template<typename Scalar >
typedef Key_t::LessThan mpblocks::dubins::kd_tree::KNearest< Scalar >::KeyCompare

Definition at line 48 of file KNearest.h.

template<typename Scalar >
typedef std::vector<Key_t> mpblocks::dubins::kd_tree::KNearest< Scalar >::KeyVec

Definition at line 49 of file KNearest.h.

template<typename Scalar >
typedef Traits<Scalar>::Node mpblocks::dubins::kd_tree::KNearest< Scalar >::Node_t

Definition at line 43 of file KNearest.h.

template<typename Scalar >
typedef Eigen::Matrix<Scalar,3,1> mpblocks::dubins::kd_tree::KNearest< Scalar >::Point

Definition at line 51 of file KNearest.h.

template<typename Scalar >
typedef std::priority_queue<Key_t,KeyVec,KeyCompare> mpblocks::dubins::kd_tree::KNearest< Scalar >::PQueue_t

Definition at line 52 of file KNearest.h.

Constructor & Destructor Documentation

template<typename Scalar >
mpblocks::dubins::kd_tree::KNearest< Scalar >::KNearest ( unsigned int  k = 1,
Scalar  radius = 1 
)

Definition at line 37 of file KNearest.hpp.

template<typename Scalar >
virtual mpblocks::dubins::kd_tree::KNearest< Scalar >::~KNearest ( )
inlinevirtual

Definition at line 65 of file KNearest.h.

Member Function Documentation

template<typename Scalar >
void mpblocks::dubins::kd_tree::KNearest< Scalar >::evaluate ( const Point q,
const Point p,
Node_t n 
)
virtual

calculates Euclidean distance from q to p, and if its less than the current best replaces the current best node with n

Definition at line 76 of file KNearest.hpp.

template<typename Scalar >
void mpblocks::dubins::kd_tree::KNearest< Scalar >::reset ( )

Definition at line 47 of file KNearest.hpp.

template<typename Scalar >
void mpblocks::dubins::kd_tree::KNearest< Scalar >::reset ( int  k,
Scalar  radius 
)

Definition at line 57 of file KNearest.hpp.

template<typename Scalar >
KNearest< Scalar >::PQueue_t & mpblocks::dubins::kd_tree::KNearest< Scalar >::result ( )

Definition at line 67 of file KNearest.hpp.

template<typename Scalar >
bool mpblocks::dubins::kd_tree::KNearest< Scalar >::shouldRecurse ( const Point q,
const HyperRect_t r 
)
virtual

evaluate the Euclidean distance from q to it's closest point in r and if that distance is less than the current best distance, return true

Definition at line 99 of file KNearest.hpp.

Member Data Documentation

template<typename Scalar >
unsigned int mpblocks::dubins::kd_tree::KNearest< Scalar >::m_boxesEvaluated

Definition at line 55 of file KNearest.h.

template<typename Scalar >
unsigned int mpblocks::dubins::kd_tree::KNearest< Scalar >::m_k
protected

Definition at line 58 of file KNearest.h.

template<typename Scalar >
unsigned int mpblocks::dubins::kd_tree::KNearest< Scalar >::m_nodesEvaluated

Definition at line 54 of file KNearest.h.

template<typename Scalar >
PQueue_t mpblocks::dubins::kd_tree::KNearest< Scalar >::m_queue
protected

Definition at line 59 of file KNearest.h.

template<typename Scalar >
Scalar mpblocks::dubins::kd_tree::KNearest< Scalar >::m_radius
protected

Definition at line 60 of file KNearest.h.


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