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

Lloyd type algorithm. More...

#include <lloydtype.h>

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

Public Member Functions

 Lloydtype (std::vector< T * > const *data=NULL, ProxyGenerator< T > *g=NULL, DissimilarityMeasure< T > *m=NULL, unsigned int maxIterations=0)
 Constructor initializing input, seeding the centers and configuring the algorithm. More...
 
 Lloydtype (std::vector< T > const &seeds, std::vector< T * > const *data=NULL, ProxyGenerator< T > *g=NULL, DissimilarityMeasure< T > *m=NULL, unsigned int maxIterations=0)
 Constructor initializing input, seeding the centers and configuring the algorithm. More...
 
 Lloydtype (std::vector< T * > const &seeds, std::vector< T * > const *data=NULL, ProxyGenerator< T > *g=NULL, DissimilarityMeasure< T > *m=NULL, unsigned int i=0)
 
 Lloydtype (const Lloydtype< T > &)
 
Lloydtype< T > & operator= (const Lloydtype< T > &)
 
virtual ~Lloydtype ()
 
virtual DoubleSolution< T > * compute ()
 
virtual void setInput (std::vector< T * > const *)
 
void setSeeding (std::vector< T > const &)
 
void setSeeding (std::vector< T * > const &)
 
void setGenerator (ProxyGenerator< T > *)
 
virtual void setMeasure (DissimilarityMeasure< T > const *)
 
- Public Member Functions inherited from CluE::Algorithm
virtual ~Algorithm ()
 

Static Public Member Functions

static Lloydtype< T > * toLloydtype (Algorithm *a)
 does a dynamic cast of the given Algorithm to Lloydtype<T> More...
 

Private Attributes

std::vector< T * > const * input
 
std::vector< T > seeding
 
ProxyGenerator< T > * generator
 
DissimilarityMeasure< T > * measure
 
unsigned int maxiterations
 

Detailed Description

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

Lloyd type algorithm.

Definition at line 27 of file lloydtype.h.

Constructor & Destructor Documentation

template<typename T >
CluE::Lloydtype< T >::Lloydtype ( std::vector< T * > const *  data = NULL,
ProxyGenerator< T > *  g = NULL,
DissimilarityMeasure< T > *  m = NULL,
unsigned int  maxIterations = 0 
)

Constructor initializing input, seeding the centers and configuring the algorithm.

Remarks
Remember to set seeding.

Definition at line 82 of file lloydtype.h.

template<typename T >
CluE::Lloydtype< T >::Lloydtype ( std::vector< T > const &  seeds,
std::vector< T * > const *  data = NULL,
ProxyGenerator< T > *  g = NULL,
DissimilarityMeasure< T > *  m = NULL,
unsigned int  maxIterations = 0 
)

Constructor initializing input, seeding the centers and configuring the algorithm.

Parameters
seedsseed for centers as vector of objects

Definition at line 88 of file lloydtype.h.

template<typename T >
CluE::Lloydtype< T >::Lloydtype ( std::vector< T * > const &  seeds,
std::vector< T * > const *  data = NULL,
ProxyGenerator< T > *  g = NULL,
DissimilarityMeasure< T > *  m = NULL,
unsigned int  i = 0 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 95 of file lloydtype.h.

template<typename T >
CluE::Lloydtype< T >::Lloydtype ( const Lloydtype< T > &  rhs)

Definition at line 103 of file lloydtype.h.

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

Definition at line 125 of file lloydtype.h.

Member Function Documentation

template<typename T >
Lloydtype< T > & CluE::Lloydtype< T >::operator= ( const Lloydtype< T > &  rhs)

Definition at line 110 of file lloydtype.h.

template<typename T >
DoubleSolution< T > * CluE::Lloydtype< T >::compute ( )
virtual
Exceptions
InvalidRuntimeConfigurationException[0] Input is NULL.
InvalidRuntimeConfigurationException[1] Dissimilarity measure is NULL.
InvalidRuntimeConfigurationException[2] Proxy generator is NULL.
InvalidRuntimeConfigurationException[3] Empty seeding.

compute new centers for non-empty altered clusters

Implements CluE::Algorithm.

Definition at line 131 of file lloydtype.h.

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

Implements CluE::InputSetter< T >.

Definition at line 225 of file lloydtype.h.

template<typename T >
void CluE::Lloydtype< T >::setSeeding ( std::vector< T > const &  seeds)

Definition at line 230 of file lloydtype.h.

template<typename T >
void CluE::Lloydtype< T >::setSeeding ( std::vector< T * > const &  seeds)

Definition at line 235 of file lloydtype.h.

template<typename T >
void CluE::Lloydtype< T >::setGenerator ( ProxyGenerator< T > *  g)

Definition at line 243 of file lloydtype.h.

template<typename T >
void CluE::Lloydtype< T >::setMeasure ( DissimilarityMeasure< T > const *  m)
virtual

Implements CluE::MeasureSetter< T >.

Definition at line 248 of file lloydtype.h.

template<typename T >
Lloydtype< T > * CluE::Lloydtype< T >::toLloydtype ( Algorithm a)
static

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

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

Definition at line 253 of file lloydtype.h.

Member Data Documentation

template<typename T>
std::vector<T*> const* CluE::Lloydtype< T >::input
private

Definition at line 75 of file lloydtype.h.

template<typename T>
std::vector<T> CluE::Lloydtype< T >::seeding
private

Definition at line 76 of file lloydtype.h.

template<typename T>
ProxyGenerator<T>* CluE::Lloydtype< T >::generator
private

Definition at line 77 of file lloydtype.h.

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

Definition at line 78 of file lloydtype.h.

template<typename T>
unsigned int CluE::Lloydtype< T >::maxiterations
private

Definition at line 79 of file lloydtype.h.


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