Public Types | Public Member Functions | Protected Attributes | List of all members
cached_ik_kinematics_plugin::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 <GreedyKCenters.h>

Public Types

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

Public Member Functions

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

Protected Attributes

DistanceFunction distFun_
 The used distance function. More...
 
std::mt19937 generator_ { std::random_device{}() }
 

Detailed Description

template<typename _T>
class cached_ik_kinematics_plugin::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 52 of file GreedyKCenters.h.

Member Typedef Documentation

template<typename _T>
using cached_ik_kinematics_plugin::GreedyKCenters< _T >::DistanceFunction = std::function<double(const _T&, const _T&)>

The definition of a distance function.

Definition at line 56 of file GreedyKCenters.h.

template<typename _T>
using cached_ik_kinematics_plugin::GreedyKCenters< _T >::Matrix = boost::numeric::ublas::matrix<double>

A matrix type for storing distances between points and centers.

Definition at line 58 of file GreedyKCenters.h.

Constructor & Destructor Documentation

template<typename _T>
cached_ik_kinematics_plugin::GreedyKCenters< _T >::GreedyKCenters ( )
default
template<typename _T>
virtual cached_ik_kinematics_plugin::GreedyKCenters< _T >::~GreedyKCenters ( )
virtualdefault

Member Function Documentation

template<typename _T>
const DistanceFunction& cached_ik_kinematics_plugin::GreedyKCenters< _T >::getDistanceFunction ( ) const
inline

Get the distance function used.

Definition at line 71 of file GreedyKCenters.h.

template<typename _T>
void cached_ik_kinematics_plugin::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 84 of file GreedyKCenters.h.

template<typename _T>
void cached_ik_kinematics_plugin::GreedyKCenters< _T >::setDistanceFunction ( const DistanceFunction distFun)
inline

Set the distance function to use.

Definition at line 65 of file GreedyKCenters.h.

Member Data Documentation

template<typename _T>
DistanceFunction cached_ik_kinematics_plugin::GreedyKCenters< _T >::distFun_
protected

The used distance function.

Definition at line 126 of file GreedyKCenters.h.

template<typename _T>
std::mt19937 cached_ik_kinematics_plugin::GreedyKCenters< _T >::generator_ { std::random_device{}() }
protected

Random number generator used to select first center

Definition at line 129 of file GreedyKCenters.h.


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


moveit_kinematics
Author(s): Dave Coleman , Ioan Sucan , Sachin Chitta
autogenerated on Sun Sep 15 2019 03:58:37