OpenMS  2.6.0
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-2020.
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 <cmath>
36 #include <limits>
37 #include <map>
38 #include <queue>
39 #include <vector>
40 #include <algorithm>
41 #include <iostream>
42 
46 
47 #ifndef OPENMS_COMPARISON_CLUSTERING_GRIDBASEDCLUSTER_H
48 #define OPENMS_COMPARISON_CLUSTERING_GRIDBASEDCLUSTER_H
49 
50 namespace OpenMS
51 {
55 class OPENMS_DLLAPI GridBasedCluster
56 {
57  public:
62 
67 
71  GridBasedCluster(const Point &centre, const Rectangle &bounding_box, const std::vector<int> &point_indices, const int &property_A, const std::vector<int> &properties_B);
72 
76  GridBasedCluster(const Point &centre, const Rectangle &bounding_box, const std::vector<int> &point_indices);
77 
81  const Point& getCentre() const;
82 
86  const Rectangle& getBoundingBox() const;
87 
91  const std::vector<int>& getPoints() const;
92 
96  int getPropertyA() const;
97 
101  const std::vector<int>& getPropertiesB() const;
102 
106  bool operator<(const GridBasedCluster& other) const;
107  bool operator>(const GridBasedCluster& other) const;
108  bool operator==(const GridBasedCluster& other) const;
109 
110  private:
115 
121 
125  std::vector<int> point_indices_;
126 
136  std::vector<int> properties_B_;
137 
138 };
139 
140 }
141 
142 #endif /* OPENMS_COMPARISON_CLUSTERING_GRIDBASEDCLUSTER_H */
OpenMS::GridBasedCluster::centre_
Point centre_
centre of the cluster
Definition: GridBasedCluster.h:114
DPosition.h
DBoundingBox.h
OpenMS::GridBasedCluster::properties_B_
std::vector< int > properties_B_
Definition: GridBasedCluster.h:136
OpenMS::operator<
bool operator<(const QTCluster &q1, const QTCluster &q2)
OpenMS::GridBasedCluster
basic data structure for clustering
Definition: GridBasedCluster.h:55
OpenMS::GridBasedCluster::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:135
OpenMS::GridBasedCluster::point_indices_
std::vector< int > point_indices_
set of indices referencing the points in the cluster
Definition: GridBasedCluster.h:125
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::GridBasedCluster::bounding_box_
Rectangle bounding_box_
bounding box of the cluster i.e. (min,max) in x and y direction
Definition: GridBasedCluster.h:120
OpenMS::GridBasedCluster::Rectangle
DBoundingBox< 2 > Rectangle
Definition: GridBasedCluster.h:66
OpenMS::DBoundingBox< 2 >
OpenMS::DPosition< 2 >
OpenMS::Internal::operator==
bool operator==(const IDBoostGraph::ProteinGroup &lhs, const IDBoostGraph::ProteinGroup &rhs)
StandardTypes.h
OpenMS::GridBasedCluster::Point
DPosition< 2 > Point
Definition: GridBasedCluster.h:61