OpenMS
GridBasedCluster.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Lars Nilse $
6 // $Authors: Lars Nilse $
7 // --------------------------------------------------------------------------
8 
9 #include <vector>
10 
14 
15 #ifndef OPENMS_COMPARISON_CLUSTERING_GRIDBASEDCLUSTER_H
16 #define OPENMS_COMPARISON_CLUSTERING_GRIDBASEDCLUSTER_H
17 
18 namespace OpenMS
19 {
23 class OPENMS_DLLAPI GridBasedCluster
24 {
25  public:
30 
35 
39  GridBasedCluster(const Point &centre, const Rectangle &bounding_box, const std::vector<int> &point_indices, const int &property_A, const std::vector<int> &properties_B);
40 
44  GridBasedCluster(const Point &centre, const Rectangle &bounding_box, const std::vector<int> &point_indices);
45 
49  const Point& getCentre() const;
50 
54  const Rectangle& getBoundingBox() const;
55 
59  const std::vector<int>& getPoints() const;
60 
64  int getPropertyA() const;
65 
69  const std::vector<int>& getPropertiesB() const;
70 
74  bool operator<(const GridBasedCluster& other) const;
75  bool operator>(const GridBasedCluster& other) const;
76  bool operator==(const GridBasedCluster& other) const;
77 
78  private:
83 
89 
93  std::vector<int> point_indices_;
94 
104  std::vector<int> properties_B_;
105 
106 };
107 
108 }
109 
110 #endif /* OPENMS_COMPARISON_CLUSTERING_GRIDBASEDCLUSTER_H */
basic data structure for clustering
Definition: GridBasedCluster.h:24
std::vector< int > point_indices_
set of indices referencing the points in the cluster
Definition: GridBasedCluster.h:93
const Point & getCentre() const
returns cluster centre
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
std::vector< int > properties_B_
Definition: GridBasedCluster.h:104
Point centre_
centre of the cluster
Definition: GridBasedCluster.h:82
const std::vector< int > & getPoints() const
returns indices of points in cluster
const std::vector< int > & getPropertiesB() const
returns properties B of all points
Rectangle bounding_box_
bounding box of the cluster i.e. (min,max) in x and y direction
Definition: GridBasedCluster.h:88
const Rectangle & getBoundingBox() const
returns bounding box
bool operator>(const GridBasedCluster &other) const
int getPropertyA() const
returns property A
int property_A_
properties A and B Each point in a cluster can (optionally) possess two properties A and B....
Definition: GridBasedCluster.h:103
bool operator<(const GridBasedCluster &other) const
operators for comparisons
DBoundingBox< 2 > Rectangle
Definition: GridBasedCluster.h:34
bool operator==(const GridBasedCluster &other) const
DPosition< 2 > Point
Definition: GridBasedCluster.h:29
GridBasedCluster(const Point &centre, const Rectangle &bounding_box, const std::vector< int > &point_indices)
initialises all data structures
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22