Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Private Attributes

ClusterHierarchical Class Reference
[Clustering]

Hierarchical clustering with generic clustering functions. More...

#include <OpenMS/COMPARISON/CLUSTERING/ClusterHierarchical.h>

List of all members.

Public Member Functions

 ClusterHierarchical ()
 default constructor
 ClusterHierarchical (const ClusterHierarchical &source)
 copy constructor
virtual ~ClusterHierarchical ()
 destructor
template<typename Data , typename SimilarityComparator >
void cluster (std::vector< Data > &data, const SimilarityComparator &comparator, const ClusterFunctor &clusterer, std::vector< BinaryTreeNode > &cluster_tree, DistanceMatrix< Real > &original_distance)
 Clustering function.
void cluster (std::vector< PeakSpectrum > &data, const BinnedSpectrumCompareFunctor &comparator, double sz, UInt sp, const ClusterFunctor &clusterer, std::vector< BinaryTreeNode > &cluster_tree, DistanceMatrix< Real > &original_distance)
 clustering function for binned PeakSpectrum
double getThreshold ()
 get the threshold
void setThreshold (double x)

Private Attributes

double threshold_
 the threshold given to the ClusterFunctor

Detailed Description

Hierarchical clustering with generic clustering functions.

ClusterHierarchical clusters objects with corresponding distancemethod and clusteringmethod.


Constructor & Destructor Documentation

ClusterHierarchical (  )  [inline]

default constructor

ClusterHierarchical ( const ClusterHierarchical source  )  [inline]

copy constructor

virtual ~ClusterHierarchical (  )  [inline, virtual]

destructor


Member Function Documentation

void cluster ( std::vector< Data > &  data,
const SimilarityComparator &  comparator,
const ClusterFunctor clusterer,
std::vector< BinaryTreeNode > &  cluster_tree,
DistanceMatrix< Real > &  original_distance 
) [inline]

Clustering function.

Conducts the SimilarityComparator with a ClusterFunctor an produces a clustering. Will create a DistanceMatrix if not yet created and start the clustering up to the given ClusterHierarchical::threshold_ used for the ClusterFunctor. The type of the objects to be clustered has to be the first template argument, the similarity functor applicable to this type must be the second template argument, e.g. for PeakSpectrum with a PeakSpectrumCompareFunctor. The similarity functor must provide the similarity calculation with the ()-operator and yield normalized values in range of [0,1] for the type of < Data >.

Parameters:
data vector of objects to be clustered
comparator similarity functor fitting for types in data
clusterer a clustermethod implementation, baseclass ClusterFunctor
cluster_tree the vector that will hold the BinaryTreeNodes representing the clustering (for further investigation with the ClusterAnalyzer methods)
original_distance the DistanceMatrix holding the pairwise distances of the elements in data, will be made newly if given size does not fit to the number of elements given in @ data
See also:
ClusterFunctor, BinaryTreeNode, ClusterAnalyzer

References DistanceMatrix< Value >::clear(), DistanceMatrix< Value >::dimensionsize(), DistanceMatrix< Value >::resize(), and DistanceMatrix< Value >::setValueQuick().

Referenced by SpectraMerger::mergeSpectraPrecursors().

double getThreshold (  )  [inline]

get the threshold

void setThreshold ( double  x  )  [inline]

set the threshold (in terms of distance) The default is 1, i.e. only at similarity 0 the clustering stops. Warning: clustering is not supported by all methods yet (e.g. SingleLinkage does ignore it).


Member Data Documentation

double threshold_ [private]

the threshold given to the ClusterFunctor


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:50 using doxygen 1.7.1