An instance of this class can be used to greedily select a given number of representatives from a set of data points that are all far apart from each other. More...
#include <hpp/fcl/knn/greedy_kcenters.h>
Public Types | |
typedef boost::function < double(const _T &, const _T &)> | DistanceFunction |
The definition of a distance function. More... | |
Public Member Functions | |
GreedyKCenters (void) | |
virtual | ~GreedyKCenters (void) |
void | setDistanceFunction (const DistanceFunction &distFun) |
Set the distance function to use. More... | |
const DistanceFunction & | getDistanceFunction (void) const |
Get the distance function used. More... | |
void | kcenters (const std::vector< _T > &data, unsigned int k, std::vector< unsigned int > ¢ers, std::vector< std::vector< double > > &dists) |
Greedy algorithm for selecting k centers. More... | |
Protected Attributes | |
DistanceFunction | distFun_ |
The used distance function. More... | |
RNG | rng_ |
Random number generator used to select first center. More... | |
An instance of this class can be used to greedily select a given number of representatives from a set of data points that are all far apart from each other.
typedef boost::function<double(const _T&, const _T&)> fcl::GreedyKCenters< _T >::DistanceFunction |
The definition of a distance function.
|
inline |
|
inlinevirtual |
|
inline |
Get the distance function used.
References fcl::GreedyKCenters< _T >::distFun_.
|
inline |
Greedy algorithm for selecting k centers.
data | a vector of data points |
k | the desired number of centers |
centers | a vector of length k containing the indices into data of the k centers |
dists | a 2-dimensional array such that dists[i][j] is the distance between data[i] and data[center[j]] |
References fcl::GreedyKCenters< _T >::distFun_, fcl::GreedyKCenters< _T >::rng_, and fcl::RNG::uniformInt().
|
inline |
Set the distance function to use.
References fcl::GreedyKCenters< _T >::distFun_.
|
protected |
The used distance function.
Referenced by fcl::GreedyKCenters< _T >::getDistanceFunction(), fcl::GreedyKCenters< _T >::kcenters(), and fcl::GreedyKCenters< _T >::setDistanceFunction().
|
protected |
Random number generator used to select first center.
Referenced by fcl::GreedyKCenters< _T >::kcenters().