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

Farthest first traversal algorithm. More...

#include <farthestfirsttraversal.h>

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

Public Member Functions

 FarthestFirstTraversal (DissimilarityMeasure< T > const *measure=0, std::vector< T * > const *input=0, unsigned int numOfSamples=0, unsigned int firstPoint=0)
 Constructor for general usage. More...
 
 FarthestFirstTraversal (const FarthestFirstTraversal< T > &)
 
FarthestFirstTraversal< T > & operator= (const FarthestFirstTraversal< T > &)
 
virtual ~FarthestFirstTraversal ()
 
virtual SolutionProvidercompute ()
 Returns an ordered DiscretesProxySolution. The first point is the starting point. More...
 
virtual void setInput (std::vector< T * > const *)
 
virtual void setMeasure (DissimilarityMeasure< T > const *measure)
 
void setNumberOfSamples (unsigned int number)
 Sets the desired number of proxies. More...
 
void setFirstPoint (unsigned int index)
 Sets the starting point. More...
 
- Public Member Functions inherited from CluE::Algorithm
virtual ~Algorithm ()
 

Static Public Member Functions

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

Private Attributes

std::vector< T * > const * input
 
DissimilarityMeasure< T > * measure
 
unsigned int number_of_samples
 
unsigned int first_point
 

Detailed Description

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

Farthest first traversal algorithm.

  1. Pick a point to start with (first point) and label it "1".
  2. Choose the point furthest from it and label it "2".
  3. Choose the point furthest from the two and label it "3".
    (n+1). Choose the point furthest from the n and label it "n+1".
    See also
    Gonzales is a clustering algorithm using n farthest-first-labeled points as proxies.

Definition at line 30 of file farthestfirsttraversal.h.

Constructor & Destructor Documentation

template<typename T >
CluE::FarthestFirstTraversal< T >::FarthestFirstTraversal ( DissimilarityMeasure< T > const *  measure = 0,
std::vector< T * > const *  input = 0,
unsigned int  numOfSamples = 0,
unsigned int  firstPoint = 0 
)

Constructor for general usage.

See also
setMeasure
setInput
setNumberOfSamples
setFirstPoint

Definition at line 83 of file farthestfirsttraversal.h.

template<typename T >
CluE::FarthestFirstTraversal< T >::FarthestFirstTraversal ( const FarthestFirstTraversal< T > &  fft)

Definition at line 91 of file farthestfirsttraversal.h.

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

Definition at line 114 of file farthestfirsttraversal.h.

Member Function Documentation

template<typename T >
FarthestFirstTraversal< T > & CluE::FarthestFirstTraversal< T >::operator= ( const FarthestFirstTraversal< T > &  fft)

Definition at line 99 of file farthestfirsttraversal.h.

template<typename T >
SolutionProvider * CluE::FarthestFirstTraversal< T >::compute ( )
virtual

Returns an ordered DiscretesProxySolution. The first point is the starting point.

Exceptions
InvalidRuntimeConfigurationException[0] Input is NULL.
InvalidRuntimeConfigurationException[1] Dissimilarity measure is NULL.
InvalidRuntimeConfigurationException[2] Empty input set.
InvalidRuntimeConfigurationException[3] Desired number of samples is 0.
InvalidRuntimeConfigurationException[4] Desired number of samples is larger than size of input.

Implements CluE::Algorithm.

Definition at line 120 of file farthestfirsttraversal.h.

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

Implements CluE::InputSetter< T >.

Definition at line 190 of file farthestfirsttraversal.h.

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

Implements CluE::MeasureSetter< T >.

Definition at line 210 of file farthestfirsttraversal.h.

template<typename T >
void CluE::FarthestFirstTraversal< T >::setNumberOfSamples ( unsigned int  number)

Sets the desired number of proxies.

Definition at line 200 of file farthestfirsttraversal.h.

template<typename T >
void CluE::FarthestFirstTraversal< T >::setFirstPoint ( unsigned int  index)

Sets the starting point.

Definition at line 195 of file farthestfirsttraversal.h.

template<typename T >
FarthestFirstTraversal< T > * CluE::FarthestFirstTraversal< T >::toFarthestFirstTraversal ( 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 205 of file farthestfirsttraversal.h.

Member Data Documentation

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

Definition at line 77 of file farthestfirsttraversal.h.

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

Definition at line 78 of file farthestfirsttraversal.h.

template<typename T>
unsigned int CluE::FarthestFirstTraversal< T >::number_of_samples
private

Definition at line 79 of file farthestfirsttraversal.h.

template<typename T>
unsigned int CluE::FarthestFirstTraversal< T >::first_point
private

Definition at line 80 of file farthestfirsttraversal.h.


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