ompl::GreedyKCenters< _T > Class Template 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 <ompl/datastructures/GreedyKCenters.h>

Public Types

using DistanceFunction = std::function< double(const _T &, const _T &)>
 The definition of a distance function.
 
using Matrix = Eigen::MatrixXd
 A matrix type for storing distances between points and centers.
 

Public Member Functions

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

Protected Attributes

DistanceFunction distFun_
 The used distance function.
 
RNG rng_
 

Detailed Description

template<typename _T>
class ompl::GreedyKCenters< _T >

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.

Definition at line 82 of file GreedyKCenters.h.

Member Function Documentation

◆ kcenters()

template<typename _T >
void ompl::GreedyKCenters< _T >::kcenters ( const std::vector< _T > &  data,
unsigned int  k,
std::vector< unsigned int > &  centers,
Matrix 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 matrix such that dists(i,j) is the distance between data[i] and data[center[j]]

Definition at line 146 of file GreedyKCenters.h.

Member Data Documentation

◆ rng_

template<typename _T >
RNG ompl::GreedyKCenters< _T >::rng_
protected

Random number generator used to select first center

Definition at line 191 of file GreedyKCenters.h.


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