OpenMS  2.6.0
Public Member Functions | Private Attributes | List of all members
ClusterProxyKD Class Reference

Proxy for a (potential) cluster. More...

#include <OpenMS/ANALYSIS/MAPMATCHING/FeatureGroupingAlgorithmKD.h>

Collaboration diagram for ClusterProxyKD:
[legend]

Public Member Functions

 ClusterProxyKD ()
 Default constructor. More...
 
 ClusterProxyKD (Size size, double avg_distance, Size center_index)
 Constructor. More...
 
 ClusterProxyKD (const ClusterProxyKD &rhs)
 Copy constructor. More...
 
 ~ClusterProxyKD ()
 Destructor (non-virtual to save memory) More...
 
ClusterProxyKDoperator= (const ClusterProxyKD &rhs)
 Assignment operator. More...
 
bool operator< (const ClusterProxyKD &rhs) const
 Less-than operator for sorting / equality check in std::set. We use the ordering in std::set as a "priority queue", hence a < b means cluster a will be preferred over b. More...
 
bool operator!= (const ClusterProxyKD &rhs) const
 Inequality operator. More...
 
bool operator== (const ClusterProxyKD &rhs) const
 Equality operator. More...
 
Size getSize () const
 Cluster size. More...
 
bool isValid () const
 Valid? More...
 
double getAvgDistance () const
 Average distance to center. More...
 
Size getCenterIndex () const
 Index of center point. More...
 

Private Attributes

Size size_
 Cluster size. More...
 
double avg_distance_
 Average distance to center. More...
 
Size center_index_
 Index of center point. More...
 

Detailed Description

Proxy for a (potential) cluster.

Proxy for a (potential) cluster. Instead of storing the entire cluster, this stores only its size, average distance to center, and the index of the center point. Objects of this class are kept in a sorted binary search tree (aka std::set) and operator< is defined in such a way that the first element of the set is always a cluster proxy for a cluster of current maximum size and smallest intra-cluster distance. The actual cluster points are then retrieved again from the kd-tree and a consensus feature is added to the output consensus map.

Constructor & Destructor Documentation

◆ ClusterProxyKD() [1/3]

ClusterProxyKD ( )
inline

Default constructor.

◆ ClusterProxyKD() [2/3]

ClusterProxyKD ( Size  size,
double  avg_distance,
Size  center_index 
)
inline

Constructor.

◆ ClusterProxyKD() [3/3]

ClusterProxyKD ( const ClusterProxyKD rhs)
inline

Copy constructor.

◆ ~ClusterProxyKD()

~ClusterProxyKD ( )
inline

Destructor (non-virtual to save memory)

Member Function Documentation

◆ getAvgDistance()

double getAvgDistance ( ) const
inline

Average distance to center.

◆ getCenterIndex()

Size getCenterIndex ( ) const
inline

Index of center point.

◆ getSize()

Size getSize ( ) const
inline

Cluster size.

◆ isValid()

bool isValid ( ) const
inline

Valid?

◆ operator!=()

bool operator!= ( const ClusterProxyKD rhs) const
inline

Inequality operator.

◆ operator<()

bool operator< ( const ClusterProxyKD rhs) const
inline

Less-than operator for sorting / equality check in std::set. We use the ordering in std::set as a "priority queue", hence a < b means cluster a will be preferred over b.

References ClusterProxyKD::avg_distance_, ClusterProxyKD::center_index_, and ClusterProxyKD::size_.

◆ operator=()

ClusterProxyKD& operator= ( const ClusterProxyKD rhs)
inline

◆ operator==()

bool operator== ( const ClusterProxyKD rhs) const
inline

Equality operator.

Member Data Documentation

◆ avg_distance_

double avg_distance_
private

Average distance to center.

Referenced by ClusterProxyKD::operator<(), and ClusterProxyKD::operator=().

◆ center_index_

Size center_index_
private

Index of center point.

Referenced by ClusterProxyKD::operator<(), and ClusterProxyKD::operator=().

◆ size_

Size size_
private

Cluster size.

Referenced by ClusterProxyKD::operator<(), and ClusterProxyKD::operator=().