#include <center_chooser.h>
Public Types | |
typedef Distance::ResultType | DistanceType |
typedef Distance::ElementType | ElementType |
Public Member Functions | |
GroupWiseCenterChooser (const Distance &distance, const std::vector< ElementType * > &points) | |
void | operator() (int k, int *indices, int indices_length, int *centers, int ¢ers_length) |
Chooses the initial centers in a way inspired by Gonzales (by Pierre-Emmanuel Viel): select the first point of the list as a candidate, then parse the points list. If another point is further than current candidate from the other centers, test if it is a good center of a local aggregation. If it is, replace current candidate by this point. And so on...
Used with KMeansIndex that computes centers coordinates by averaging positions of clusters points, this doesn't make a real difference with previous methods. But used with HierarchicalClusteringIndex class that pick centers among existing points instead of computing the barycenters, there is a real improvement.
Definition at line 307 of file center_chooser.h.
typedef Distance::ResultType rtflann::GroupWiseCenterChooser< Distance >::DistanceType |
Reimplemented from rtflann::CenterChooser< Distance >.
Definition at line 311 of file center_chooser.h.
typedef Distance::ElementType rtflann::GroupWiseCenterChooser< Distance >::ElementType |
Reimplemented from rtflann::CenterChooser< Distance >.
Definition at line 310 of file center_chooser.h.
rtflann::GroupWiseCenterChooser< Distance >::GroupWiseCenterChooser | ( | const Distance & | distance, |
const std::vector< ElementType * > & | points | ||
) | [inline] |
Definition at line 317 of file center_chooser.h.
void rtflann::GroupWiseCenterChooser< Distance >::operator() | ( | int | k, |
int * | indices, | ||
int | indices_length, | ||
int * | centers, | ||
int & | centers_length | ||
) | [inline, virtual] |
Chooses cluster centers
k | number of centers to choose |
indices | indices of points to choose the centers from |
indices_length | length of indices |
centers | indices of chosen centers |
centers_length | length of centers array |
Implements rtflann::CenterChooser< Distance >.
Definition at line 320 of file center_chooser.h.