Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

BaseMapMatcher.h (Maintainer: Eva Lange)

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // --------------------------------------------------------------------------
00005 //                   OpenMS Mass Spectrometry Framework
00006 // --------------------------------------------------------------------------
00007 //  Copyright (C) 2003-2008 -- Oliver Kohlbacher, Knut Reinert
00008 //
00009 //  This library is free software; you can redistribute it and/or
00010 //  modify it under the terms of the GNU Lesser General Public
00011 //  License as published by the Free Software Foundation; either
00012 //  version 2.1 of the License, or (at your option) any later version.
00013 //
00014 //  This library is distributed in the hope that it will be useful,
00015 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 //  Lesser General Public License for more details.
00018 //
00019 //  You should have received a copy of the GNU Lesser General Public
00020 //  License along with this library; if not, write to the Free Software
00021 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //
00023 // --------------------------------------------------------------------------
00024 // $Maintainer: Eva Lange $
00025 // --------------------------------------------------------------------------
00026 
00027 
00028 #ifndef OPENMS_ANALYSIS_MAPMATCHING_BASEMAPMATCHER_H
00029 #define OPENMS_ANALYSIS_MAPMATCHING_BASEMAPMATCHER_H
00030 
00031 #include <OpenMS/KERNEL/Feature.h>
00032 #include <OpenMS/DATASTRUCTURES/DRange.h>
00033 #include <OpenMS/ANALYSIS/MAPMATCHING/ElementPair.h>
00034 #include <OpenMS/ANALYSIS/MAPMATCHING/Grid.h>
00035 
00036 #include <utility>
00037 
00038 namespace OpenMS
00039 {
00040 
00053   template <typename ElementT = Feature >
00054   class BaseMapMatcher
00055   {
00056   public:
00058     typedef ElementT ElementType;
00060     typedef std::vector< ElementPair < ElementType > > ElementPairVector;
00062     typedef DoubleReal QualityType;
00063 
00065     BaseMapMatcher() : min_quality_(-1)
00066     {}
00067 
00069     bool operator == (const BaseMapMatcher& rhs)
00070     {
00071       return (grid_          == rhs.grid_ &&
00072               element_pairs_ == rhs.element_pairs_ &&
00073               min_quality_   == rhs.min_quality_);
00074     }
00075 
00077     virtual ~BaseMapMatcher()
00078     {}
00079 
00081     void setGrid(const Grid& g)
00082     {
00083       grid_ = g;
00084     }
00086     Grid& getGrid()
00087     {
00088       return grid_;
00089     }
00091     const Grid & getGrid() const
00092     {
00093       return grid_;
00094     }
00095 
00097     void setElementPairs(const ElementPairVector& plist)
00098     {
00099       element_pairs_ = plist;
00100     }
00102     ElementPairVector& getElementPairs()
00103     {
00104       return element_pairs_;
00105     }
00107     const ElementPairVector& getElementPairs() const
00108     {
00109       return element_pairs_;
00110     }
00111 
00113     void setMinQuality(QualityType qu)
00114     {
00115       min_quality_ = qu;
00116     }
00118     QualityType& getMinQuality()
00119     {
00120       return min_quality_;
00121     }
00123     QualityType getMinQuality() const
00124     {
00125       return min_quality_;
00126     }
00127 
00129     virtual void estimateTransform() = 0;
00130 
00131   protected:
00133     Grid grid_;
00134 
00136     ElementPairVector element_pairs_;
00137 
00139     QualityType min_quality_;
00140 
00141   }
00142   ; // end of class BaseMapMatcher
00143 
00144 } // end of namespace OpenMS
00145 
00146 #endif  // OPENMS_ANALYSIS_MAPMATCHER_DBASEMAPMATCHER_H

Generated Tue Apr 1 15:36:32 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1