00001 #ifndef __MGFP_INCLUDE_MASSABUNDANCEPAIR_H__
00002 #define __MGFP_INCLUDE_MASSABUNDANCEPAIR_H__
00003
00004 #include <mgfp/config.h>
00005
00006 #include <utility>
00007 #include <functional>
00008
00012 namespace mgf {
00013
00016 typedef std::pair<double, double> MassAbundancePair;
00017
00020 struct LessThanMz : std::binary_function<bool, MassAbundancePair,
00021 MassAbundancePair> {
00022 bool operator()(const MassAbundancePair& lhs,
00023 const MassAbundancePair& rhs) {
00024 return lhs.first < rhs.first;
00025 }
00026 bool operator()(const double lhs, const MassAbundancePair& rhs) {
00027 return lhs < rhs.first;
00028 }
00029 bool operator()(const MassAbundancePair& lhs, const double rhs) {
00030 return lhs.first < rhs;
00031 }
00032 };
00033
00036 struct LessThanAbundance : std::binary_function<bool, MassAbundancePair,
00037 MassAbundancePair> {
00038 bool operator()(const MassAbundancePair& lhs,
00039 const MassAbundancePair& rhs) {
00040 return lhs.second < rhs.second;
00041 }
00042 };
00043
00044 }
00045
00046 #endif
00047