OpenMS
GridBasedCluster.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2023.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Lars Nilse $
32 // $Authors: Lars Nilse $
33 // --------------------------------------------------------------------------
34 
35 #include <vector>
36 
40 
41 #ifndef OPENMS_COMPARISON_CLUSTERING_GRIDBASEDCLUSTER_H
42 #define OPENMS_COMPARISON_CLUSTERING_GRIDBASEDCLUSTER_H
43 
44 namespace OpenMS
45 {
49 class OPENMS_DLLAPI GridBasedCluster
50 {
51  public:
56 
61 
65  GridBasedCluster(const Point &centre, const Rectangle &bounding_box, const std::vector<int> &point_indices, const int &property_A, const std::vector<int> &properties_B);
66 
70  GridBasedCluster(const Point &centre, const Rectangle &bounding_box, const std::vector<int> &point_indices);
71 
75  const Point& getCentre() const;
76 
80  const Rectangle& getBoundingBox() const;
81 
85  const std::vector<int>& getPoints() const;
86 
90  int getPropertyA() const;
91 
95  const std::vector<int>& getPropertiesB() const;
96 
100  bool operator<(const GridBasedCluster& other) const;
101  bool operator>(const GridBasedCluster& other) const;
102  bool operator==(const GridBasedCluster& other) const;
103 
104  private:
109 
115 
119  std::vector<int> point_indices_;
120 
130  std::vector<int> properties_B_;
131 
132 };
133 
134 }
135 
136 #endif /* OPENMS_COMPARISON_CLUSTERING_GRIDBASEDCLUSTER_H */
basic data structure for clustering
Definition: GridBasedCluster.h:50
std::vector< int > point_indices_
set of indices referencing the points in the cluster
Definition: GridBasedCluster.h:119
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:130
Point centre_
centre of the cluster
Definition: GridBasedCluster.h:108
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:114
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:129
bool operator<(const GridBasedCluster &other) const
operators for comparisons
DBoundingBox< 2 > Rectangle
Definition: GridBasedCluster.h:60
bool operator==(const GridBasedCluster &other) const
DPosition< 2 > Point
Definition: GridBasedCluster.h:55
GridBasedCluster(const Point &centre, const Rectangle &bounding_box, const std::vector< int > &point_indices)
initialises all data structures
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48