OpenMS
SingleLinkage Class Reference

SingleLinkage ClusterMethod. More...

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

Inheritance diagram for SingleLinkage:
[legend]
Collaboration diagram for SingleLinkage:
[legend]

Public Member Functions

 SingleLinkage ()
 default constructor More...
 
 SingleLinkage (const SingleLinkage &source)
 copy constructor More...
 
 ~SingleLinkage () override
 destructor More...
 
SingleLinkageoperator= (const SingleLinkage &source)
 assignment operator More...
 
void operator() (DistanceMatrix< float > &original_distance, std::vector< BinaryTreeNode > &cluster_tree, const float threshold=1) const override
 clusters the indices according to their respective element distances More...
 
- Public Member Functions inherited from ClusterFunctor
 ClusterFunctor ()
 default constructor More...
 
 ClusterFunctor (const ClusterFunctor &source)
 copy constructor More...
 
virtual ~ClusterFunctor ()
 destructor More...
 
ClusterFunctoroperator= (const ClusterFunctor &source)
 assignment operator More...
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor. More...
 
virtual ~ProgressLogger ()
 Destructor. More...
 
 ProgressLogger (const ProgressLogger &other)
 Copy constructor. More...
 
ProgressLoggeroperator= (const ProgressLogger &other)
 Assignment Operator. More...
 
void setLogType (LogType type) const
 Sets the progress log that should be used. The default type is NONE! More...
 
LogType getLogType () const
 Returns the type of progress log being used. More...
 
void startProgress (SignedSize begin, SignedSize end, const String &label) const
 Initializes the progress display. More...
 
void setProgress (SignedSize value) const
 Sets the current progress. More...
 
void endProgress () const
 Ends the progress display. More...
 
void nextProgress () const
 increment progress by 1 (according to range begin-end) More...
 

Static Public Member Functions

static ClusterFunctorcreate ()
 creates a new instance of a SingleLinkage object More...
 
static const String getProductName ()
 get the identifier for this object More...
 
- Static Public Member Functions inherited from ClusterFunctor
static void registerChildren ()
 registers all derived products More...
 

Additional Inherited Members

- Public Types inherited from ProgressLogger
enum  LogType { CMD , GUI , NONE }
 Possible log types. More...
 
- Static Protected Member Functions inherited from ProgressLogger
static String logTypeToFactoryName_ (LogType type)
 Return the name of the factory product used for this log type. More...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

SingleLinkage ClusterMethod.

The details of the method can be found in: SLINK: An optimally efficient algorithm for the single-link cluster method, The Computer Journal 1973 16(1):30-34; doi:10.1093/comjnl/16.1.30

See also
ClusterFunctor() base class.

Constructor & Destructor Documentation

◆ SingleLinkage() [1/2]

default constructor

◆ SingleLinkage() [2/2]

SingleLinkage ( const SingleLinkage source)

copy constructor

◆ ~SingleLinkage()

~SingleLinkage ( )
override

destructor

Member Function Documentation

◆ create()

static ClusterFunctor* create ( )
static

creates a new instance of a SingleLinkage object

◆ getProductName()

static const String getProductName ( )
static

get the identifier for this object

◆ operator()()

void operator() ( DistanceMatrix< float > &  original_distance,
std::vector< BinaryTreeNode > &  cluster_tree,
const float  threshold = 1 
) const
overridevirtual

clusters the indices according to their respective element distances

Parameters
original_distanceDistanceMatrix<float> containing the distances of the elements to be clustered
cluster_treevector< BinaryTreeNode >, represents the clustering, each node contains the next two clusters merged and their distance, strict order is kept: left_child < right_child
thresholdfloat value to meet Base class interface, will not be used because algorithm used is considerably fast and does not work by growing distances
Exceptions
ClusterFunctor::InsufficientInputthrown if input is <2 The clustering method is single linkage, where the updated distances after merging two clusters are each the minimal distance between the elements of their clusters.
See also
ClusterFunctor , BinaryTreeNode

Implements ClusterFunctor.

◆ operator=()

SingleLinkage& operator= ( const SingleLinkage source)

assignment operator