CMS 3D CMS Logo

ComplexComparesAbs.h
Go to the documentation of this file.
1 #ifndef NPSTAT_COMPLEXCOMPARESABS_HH_
2 #define NPSTAT_COMPLEXCOMPARESABS_HH_
3 
14 #include <cmath>
15 #include <complex>
16 
17 namespace npstat {
23  template <class T>
25  inline static bool less(const T& l, const T& r) { return l < r; }
26 
27  inline static bool more(const T& l, const T& r) { return l > r; }
28  };
29 
30  template <class T>
31  struct ComplexComparesAbs<std::complex<T> > {
32  inline static bool less(const std::complex<T>& l, const std::complex<T>& r) { return std::abs(l) < std::abs(r); }
33 
34  inline static bool more(const std::complex<T>& l, const std::complex<T>& r) { return std::abs(l) > std::abs(l); }
35  };
36 } // namespace npstat
37 
38 #endif // NPSTAT_COMPLEXCOMPARESABS_HH_
static bool less(const T &l, const T &r)
static bool less(const std::complex< T > &l, const std::complex< T > &r)
static bool more(const std::complex< T > &l, const std::complex< T > &r)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static bool more(const T &l, const T &r)
long double T