All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
ompl::GreedyKCenters Class Reference

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 <GreedyKCenters.h>

List of all members.

Public Types

typedef boost::function2
< double, const _T &, const _T & > 
DistanceFunction
 The definition of a distance function.

Public Member Functions

void setDistanceFunction (const DistanceFunction &distFun)
 Set the distance function to use.
const DistanceFunctiongetDistanceFunction (void) const
 Get the distance function used.
void kcenters (const std::vector< _T > &data, unsigned int k, std::vector< unsigned int > &centers, std::vector< std::vector< double > > &dists)
 Greedy algorithm for selecting k centers.

Protected Attributes

DistanceFunction distFun_
 The used distance function.
RNG rng_

Detailed Description

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.


Member Function Documentation

void ompl::GreedyKCenters::kcenters ( const std::vector< _T > &  data,
unsigned int  k,
std::vector< unsigned int > &  centers,
std::vector< std::vector< double > > &  dists 
) [inline]

Greedy algorithm for selecting k centers.

Parameters:
dataa vector of data points
kthe desired number of centers
centersa vector of length k containing the indices into data of the k centers
distsa 2-dimensional array such that dists[i][j] is the distance between data[i] and data[center[j]]

Definition at line 82 of file GreedyKCenters.h.


Member Data Documentation

Random number generator used to select first center

Definition at line 126 of file GreedyKCenters.h.


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