CluE  1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CluE::KumarSabharwalSen< T > Class Template Reference

KumarSabharwalSen algorithm. More...

#include <kumarsabharwalsen.h>

Inheritance diagram for CluE::KumarSabharwalSen< T >:
Inheritance graph
Collaboration diagram for CluE::KumarSabharwalSen< T >:
Collaboration graph

Classes

struct  Tupel
 Used to return a DoubleSolution and its cost. More...
 

Public Member Functions

 KumarSabharwalSen (DissimilarityMeasure< T > const *measure=0, ProxyGenerator< T > const *centroidGenerator=0, unsigned int numberOfClusters=2, std::vector< T * > const *input=0)
 Constructor for general usage. More...
 
 KumarSabharwalSen (const KumarSabharwalSen< T > &)
 
KumarSabharwalSen< T > & operator= (const KumarSabharwalSen< T > &)
 
virtual ~KumarSabharwalSen ()
 
virtual DoubleSolution< T > * compute ()
 
double getLastCost ()
 Returns the cost of the last computation. More...
 
virtual void setInput (std::vector< T * > const *)
 
virtual void setMeasure (DissimilarityMeasure< T > const *measure)
 
void setCentroidGenerator (ProxyGenerator< T > const *centroidGenerator)
 Set the centroid generator used for cluster center approximation. More...
 
void setSetSizes (unsigned int superSetSize, unsigned int subsetSize)
 Set the superset and subset sizes used for guessing clusters. More...
 
- Public Member Functions inherited from CluE::Algorithm
virtual ~Algorithm ()
 

Static Public Member Functions

static KumarSabharwalSen< T > * toKumarSabharwalSen (Algorithm *s)
 does a dynamic cast of the given Algorithm to FarthestFirstTraversal<T> More...
 

Private Member Functions

Tupel irredKMeans (std::set< T * > Q, size_t m, size_t k, std::map< size_t, T > C, double Sum)
 

Private Attributes

DissimilarityMeasure< T > * measure
 
std::set< T * > input
 
ProxyGenerator< T > * centroidGenerator
 
unsigned int superSetSize
 
unsigned int subsetSize
 
unsigned int numberOfClusters
 
double lastCost
 

Detailed Description

template<typename T>
class CluE::KumarSabharwalSen< T >

KumarSabharwalSen algorithm.

Approxmative (1+epsilon) clustering algorithm as described in A. Kumar, Y. Sabharwal and S. Sen. "A Simple Linear Time (1+epsilon)-Approximation Algorithm for k-Means Clustering in Any Dimensions". ???, 2005.

Definition at line 31 of file kumarsabharwalsen.h.

Constructor & Destructor Documentation

template<typename T >
CluE::KumarSabharwalSen< T >::KumarSabharwalSen ( DissimilarityMeasure< T > const *  measure = 0,
ProxyGenerator< T > const *  centroidGenerator = 0,
unsigned int  numberOfClusters = 2,
std::vector< T * > const *  input = 0 
)

Constructor for general usage.

Note
Remember to set the set sizes.
See also
setSetSizes

Definition at line 112 of file kumarsabharwalsen.h.

template<typename T >
CluE::KumarSabharwalSen< T >::KumarSabharwalSen ( const KumarSabharwalSen< T > &  kss)

Definition at line 124 of file kumarsabharwalsen.h.

template<typename T >
CluE::KumarSabharwalSen< T >::~KumarSabharwalSen ( )
virtual

Definition at line 155 of file kumarsabharwalsen.h.

Member Function Documentation

template<typename T >
KumarSabharwalSen< T > & CluE::KumarSabharwalSen< T >::operator= ( const KumarSabharwalSen< T > &  kss)

Definition at line 135 of file kumarsabharwalsen.h.

template<typename T >
DoubleSolution< T > * CluE::KumarSabharwalSen< T >::compute ( )
virtual
Exceptions
InvalidRuntimeConfigurationException[0] Number of desired clusters is 0.
InvalidRuntimeConfigurationException[1] Input size must be larger than number of desired clusters.
InvalidRuntimeConfigurationException[2] Set sizes are uninitialized.

Implements CluE::Algorithm.

Definition at line 163 of file kumarsabharwalsen.h.

template<typename T >
double CluE::KumarSabharwalSen< T >::getLastCost ( )

Returns the cost of the last computation.

Definition at line 315 of file kumarsabharwalsen.h.

template<typename T >
void CluE::KumarSabharwalSen< T >::setInput ( std::vector< T * > const *  data)
virtual

Implements CluE::InputSetter< T >.

Definition at line 320 of file kumarsabharwalsen.h.

template<typename T >
void CluE::KumarSabharwalSen< T >::setMeasure ( DissimilarityMeasure< T > const *  measure)
virtual

Implements CluE::MeasureSetter< T >.

Definition at line 326 of file kumarsabharwalsen.h.

template<typename T >
void CluE::KumarSabharwalSen< T >::setCentroidGenerator ( ProxyGenerator< T > const *  centroidGenerator)

Set the centroid generator used for cluster center approximation.

See also
[KumarSabharwelSen], 2. Preliminaries.

Definition at line 334 of file kumarsabharwalsen.h.

template<typename T >
void CluE::KumarSabharwalSen< T >::setSetSizes ( unsigned int  superSetSize,
unsigned int  subsetSize 
)

Set the superset and subset sizes used for guessing clusters.

See also
[KumarSabharwalSen], 4.2 The algorithm.
Exceptions
InvalidArgumentException[0] subsetSize has to be smaller than superSetSize. subsetSize.

Definition at line 342 of file kumarsabharwalsen.h.

template<typename T >
KumarSabharwalSen< T > * CluE::KumarSabharwalSen< T >::toKumarSabharwalSen ( Algorithm s)
static

does a dynamic cast of the given Algorithm to FarthestFirstTraversal<T>

Returns
NULL if the Algorithm is not a FarthestFirstTraversal<T> instance

Definition at line 352 of file kumarsabharwalsen.h.

template<typename T >
KumarSabharwalSen< T >::Tupel CluE::KumarSabharwalSen< T >::irredKMeans ( std::set< T * >  Q,
size_t  m,
size_t  k,
std::map< size_t, T >  C,
double  Sum 
)
private

Definition at line 184 of file kumarsabharwalsen.h.

Member Data Documentation

template<typename T>
DissimilarityMeasure<T>* CluE::KumarSabharwalSen< T >::measure
private

Definition at line 103 of file kumarsabharwalsen.h.

template<typename T>
std::set<T*> CluE::KumarSabharwalSen< T >::input
private

Definition at line 104 of file kumarsabharwalsen.h.

template<typename T>
ProxyGenerator<T>* CluE::KumarSabharwalSen< T >::centroidGenerator
private

Definition at line 105 of file kumarsabharwalsen.h.

template<typename T>
unsigned int CluE::KumarSabharwalSen< T >::superSetSize
private

Definition at line 106 of file kumarsabharwalsen.h.

template<typename T>
unsigned int CluE::KumarSabharwalSen< T >::subsetSize
private

Definition at line 107 of file kumarsabharwalsen.h.

template<typename T>
unsigned int CluE::KumarSabharwalSen< T >::numberOfClusters
private

Definition at line 108 of file kumarsabharwalsen.h.

template<typename T>
double CluE::KumarSabharwalSen< T >::lastCost
private

Definition at line 109 of file kumarsabharwalsen.h.


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