Public Member Functions | Protected Types | Protected Attributes | List of all members
cvflann::KNNRadiusUniqueResultSet< DistanceType > Class Template Reference

#include <result_set.h>

Inherits cvflann::KNNUniqueResultSet< DistanceType >.

Public Member Functions

 KNNRadiusUniqueResultSet (unsigned int capacity, DistanceType radius)
 
void clear ()
 
void addPoint (DistanceType dist, int index)
 
bool full () const
 
virtual void copy (int *indices, DistanceType *dist, int n_neighbors=-1) const
 
virtual void sortAndCopy (int *indices, DistanceType *dist, int n_neighbors=-1) const
 
size_t size () const
 
DistanceType worstDist () const
 

Protected Types

typedef UniqueResultSet
< DistanceType >::DistIndex 
DistIndex
 

Protected Attributes

bool is_full_
 
DistanceType worst_distance_
 
std::set< DistIndexdist_indices_
 

Detailed Description

template<typename DistanceType>
class cvflann::KNNRadiusUniqueResultSet< DistanceType >

Class that holds the k NN neighbors within a radius distance

Member Typedef Documentation

template<typename DistanceType>
typedef UniqueResultSet<DistanceType>::DistIndex cvflann::KNNUniqueResultSet< DistanceType >::DistIndex
protectedinherited

Constructor & Destructor Documentation

template<typename DistanceType >
cvflann::KNNRadiusUniqueResultSet< DistanceType >::KNNRadiusUniqueResultSet ( unsigned int  capacity,
DistanceType  radius 
)

Constructor

Parameters
capacitythe number of neighbors to store at max

Member Function Documentation

template<typename DistanceType >
void cvflann::KNNRadiusUniqueResultSet< DistanceType >::clear ( )
virtual

Remove all elements in the set

Reimplemented from cvflann::KNNUniqueResultSet< DistanceType >.

template<typename DistanceType>
void cvflann::KNNUniqueResultSet< DistanceType >::addPoint ( DistanceType  dist,
int  index 
)
virtualinherited

Add a possible candidate to the best neighbors

Parameters
distdistance for that neighbor
indexindex of that neighbor

Implements cvflann::ResultSet< DistanceType >.

template<typename DistanceType >
bool cvflann::UniqueResultSet< DistanceType >::full ( ) const
virtualinherited

Check the status of the set

Returns
true if we have k NN

Implements cvflann::ResultSet< DistanceType >.

Reimplemented in cvflann::RadiusUniqueResultSet< DistanceType >.

template<typename DistanceType >
virtual void cvflann::UniqueResultSet< DistanceType >::copy ( int indices,
DistanceType *  dist,
int  n_neighbors = -1 
) const
virtualinherited

Copy the set to two C arrays

Parameters
indicespointer to a C array of indices
distpointer to a C array of distances
n_neighborsthe number of neighbors to copy
template<typename DistanceType >
virtual void cvflann::UniqueResultSet< DistanceType >::sortAndCopy ( int indices,
DistanceType *  dist,
int  n_neighbors = -1 
) const
virtualinherited

Copy the set to two C arrays but sort it according to the distance first

Parameters
indicespointer to a C array of indices
distpointer to a C array of distances
n_neighborsthe number of neighbors to copy
template<typename DistanceType >
size_t cvflann::UniqueResultSet< DistanceType >::size ( ) const
inherited

The number of neighbors in the set

Returns
template<typename DistanceType >
DistanceType cvflann::UniqueResultSet< DistanceType >::worstDist ( ) const
virtualinherited

The distance of the furthest neighbor If we don't have enough neighbors, it returns the max possible value

Returns

Implements cvflann::ResultSet< DistanceType >.

Reimplemented in cvflann::RadiusUniqueResultSet< DistanceType >.

Member Data Documentation

template<typename DistanceType >
bool cvflann::UniqueResultSet< DistanceType >::is_full_
protectedinherited

Flag to say if the set is full

template<typename DistanceType >
DistanceType cvflann::UniqueResultSet< DistanceType >::worst_distance_
protectedinherited

The worst distance found so far

template<typename DistanceType >
std::set<DistIndex> cvflann::UniqueResultSet< DistanceType >::dist_indices_
protectedinherited

The best candidates so far


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