OpenMS
GridBasedCluster Class Reference

basic data structure for clustering More...

#include <OpenMS/ML/CLUSTERING/GridBasedCluster.h>

Collaboration diagram for GridBasedCluster:
[legend]

Public Types

typedef DPosition< 2 > Point
 
typedef DBoundingBox< 2 > Rectangle
 

Public Member Functions

 GridBasedCluster (const Point &centre, const Rectangle &bounding_box, const std::vector< int > &point_indices, const int &property_A, const std::vector< int > &properties_B)
 initialises all data structures More...
 
 GridBasedCluster (const Point &centre, const Rectangle &bounding_box, const std::vector< int > &point_indices)
 initialises all data structures More...
 
const PointgetCentre () const
 returns cluster centre More...
 
const RectanglegetBoundingBox () const
 returns bounding box More...
 
const std::vector< int > & getPoints () const
 returns indices of points in cluster More...
 
int getPropertyA () const
 returns property A More...
 
const std::vector< int > & getPropertiesB () const
 returns properties B of all points More...
 
bool operator< (const GridBasedCluster &other) const
 operators for comparisons More...
 
bool operator> (const GridBasedCluster &other) const
 
bool operator== (const GridBasedCluster &other) const
 

Private Attributes

Point centre_
 centre of the cluster More...
 
Rectangle bounding_box_
 bounding box of the cluster i.e. (min,max) in x and y direction More...
 
std::vector< int > point_indices_
 set of indices referencing the points in the cluster More...
 
int property_A_
 properties A and B Each point in a cluster can (optionally) possess two properties A and B. For two points to be in the same cluster, they need to have the same property A, e.g. the same charge. For two points to be in the same cluster, they need to have different properties B, e.g. originate from two different maps. -1 means properties are not set. More...
 
std::vector< int > properties_B_
 

Detailed Description

basic data structure for clustering

Member Typedef Documentation

◆ Point

typedef DPosition<2> Point

centre of a cluster

◆ Rectangle

typedef DBoundingBox<2> Rectangle

bounding box of a cluster

Constructor & Destructor Documentation

◆ GridBasedCluster() [1/2]

GridBasedCluster ( const Point centre,
const Rectangle bounding_box,
const std::vector< int > &  point_indices,
const int &  property_A,
const std::vector< int > &  properties_B 
)

initialises all data structures

◆ GridBasedCluster() [2/2]

GridBasedCluster ( const Point centre,
const Rectangle bounding_box,
const std::vector< int > &  point_indices 
)

initialises all data structures

Member Function Documentation

◆ getBoundingBox()

const Rectangle& getBoundingBox ( ) const

returns bounding box

Referenced by GridBasedClustering< Metric >::cluster().

◆ getCentre()

const Point& getCentre ( ) const

◆ getPoints()

const std::vector<int>& getPoints ( ) const

returns indices of points in cluster

Referenced by GridBasedClustering< Metric >::cluster().

◆ getPropertiesB()

const std::vector<int>& getPropertiesB ( ) const

returns properties B of all points

Referenced by GridBasedClustering< Metric >::cluster(), and GridBasedClustering< Metric >::mergeVeto_().

◆ getPropertyA()

int getPropertyA ( ) const

◆ operator<()

bool operator< ( const GridBasedCluster other) const

operators for comparisons

◆ operator==()

bool operator== ( const GridBasedCluster other) const

◆ operator>()

bool operator> ( const GridBasedCluster other) const

Member Data Documentation

◆ bounding_box_

Rectangle bounding_box_
private

bounding box of the cluster i.e. (min,max) in x and y direction

◆ centre_

Point centre_
private

centre of the cluster

◆ point_indices_

std::vector<int> point_indices_
private

set of indices referencing the points in the cluster

◆ properties_B_

std::vector<int> properties_B_
private

◆ property_A_

int property_A_
private

properties A and B Each point in a cluster can (optionally) possess two properties A and B. For two points to be in the same cluster, they need to have the same property A, e.g. the same charge. For two points to be in the same cluster, they need to have different properties B, e.g. originate from two different maps. -1 means properties are not set.