moveit2
The MoveIt Motion Planning Framework for ROS 2.
|
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 = Eigen::MatrixXd |
A matrix type for storing distances between points and centers. More... | |
Public Member Functions | |
GreedyKCenters ()=default | |
GreedyKCenters (const GreedyKCenters &)=default | |
GreedyKCenters (GreedyKCenters &&) noexcept=default | |
GreedyKCenters & | operator= (const GreedyKCenters &)=default |
GreedyKCenters & | operator= (GreedyKCenters &&) noexcept=default |
virtual | ~GreedyKCenters ()=default |
void | setDistanceFunction (const DistanceFunction &distFun) |
Set the distance function to use. More... | |
const DistanceFunction & | getDistanceFunction () const |
Get the distance function used. More... | |
void | kcenters (const std::vector< _T > &data, unsigned int k, std::vector< unsigned int > ¢ers, Matrix &dists) |
Greedy algorithm for selecting k centers. More... | |
Protected Attributes | |
DistanceFunction | distFun_ |
The used distance function. More... | |
std::mt19937 | generator_ { std::random_device{}() } |
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 51 of file GreedyKCenters.h.
using cached_ik_kinematics_plugin::GreedyKCenters< _T >::DistanceFunction = std::function<double(const _T&, const _T&)> |
The definition of a distance function.
Definition at line 55 of file GreedyKCenters.h.
using cached_ik_kinematics_plugin::GreedyKCenters< _T >::Matrix = Eigen::MatrixXd |
A matrix type for storing distances between points and centers.
Definition at line 57 of file GreedyKCenters.h.
|
default |
|
default |
|
defaultnoexcept |
|
virtualdefault |
|
inline |
Get the distance function used.
Definition at line 73 of file GreedyKCenters.h.
|
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 matrix such that dists(i,j) is the distance between data[i] and data[center[j]] |
Definition at line 86 of file GreedyKCenters.h.
|
default |
|
defaultnoexcept |
|
inline |
Set the distance function to use.
Definition at line 67 of file GreedyKCenters.h.
|
protected |
The used distance function.
Definition at line 128 of file GreedyKCenters.h.
|
protected |
Random number generator used to select first center
Definition at line 131 of file GreedyKCenters.h.