#include <result_set.h>
Inherits cvflann::ResultSet< DistanceType >.
Inherited by cvflann::KNNUniqueResultSet< DistanceType >, and cvflann::RadiusUniqueResultSet< DistanceType >.
Classes | |
| struct | DistIndex |
Public Member Functions | |
| UniqueResultSet () | |
| bool | full () const |
| virtual void | clear ()=0 |
| 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 |
| virtual void | addPoint (DistanceType dist, int index)=0 |
Protected Attributes | |
| bool | is_full_ |
| DistanceType | worst_distance_ |
| std::set< DistIndex > | dist_indices_ |
Class that holds the k NN neighbors Faster than KNNResultSet as it uses a binary heap and does not maintain two arrays
| cvflann::UniqueResultSet< DistanceType >::UniqueResultSet | ( | ) |
Default cosntructor
| bool cvflann::UniqueResultSet< DistanceType >::full | ( | ) | const [virtual] |
Check the status of the set
Implements cvflann::ResultSet< DistanceType >.
Reimplemented in cvflann::RadiusUniqueResultSet< DistanceType >.
| virtual void cvflann::UniqueResultSet< DistanceType >::clear | ( | ) | [pure virtual] |
Remove all elements in the set
Implemented in cvflann::KNNRadiusUniqueResultSet< DistanceType >, cvflann::RadiusUniqueResultSet< DistanceType >, and cvflann::KNNUniqueResultSet< DistanceType >.
| virtual void cvflann::UniqueResultSet< DistanceType >::copy | ( | int * | indices, |
| DistanceType * | dist, | ||
| int | n_neighbors = -1 |
||
| ) | const [virtual] |
Copy the set to two C arrays
| indices | pointer to a C array of indices |
| dist | pointer to a C array of distances |
| n_neighbors | the number of neighbors to copy |
| virtual void cvflann::UniqueResultSet< DistanceType >::sortAndCopy | ( | int * | indices, |
| DistanceType * | dist, | ||
| int | n_neighbors = -1 |
||
| ) | const [virtual] |
Copy the set to two C arrays but sort it according to the distance first
| indices | pointer to a C array of indices |
| dist | pointer to a C array of distances |
| n_neighbors | the number of neighbors to copy |
| size_t cvflann::UniqueResultSet< DistanceType >::size | ( | ) | const |
The number of neighbors in the set
| DistanceType cvflann::UniqueResultSet< DistanceType >::worstDist | ( | ) | const [virtual] |
The distance of the furthest neighbor If we don't have enough neighbors, it returns the max possible value
Implements cvflann::ResultSet< DistanceType >.
Reimplemented in cvflann::RadiusUniqueResultSet< DistanceType >.
| virtual void cvflann::ResultSet< DistanceType >::addPoint | ( | DistanceType | dist, |
| int | index | ||
| ) | [pure virtual, inherited] |
bool cvflann::UniqueResultSet< DistanceType >::is_full_ [protected] |
Flag to say if the set is full
DistanceType cvflann::UniqueResultSet< DistanceType >::worst_distance_ [protected] |
The worst distance found so far
std::set<DistIndex> cvflann::UniqueResultSet< DistanceType >::dist_indices_ [protected] |
The best candidates so far