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  {
26  inline static bool less(const T& l, const T& r)
27  {return l < r;}
28 
29  inline static bool more(const T& l, const T& r)
30  {return l > r;}
31  };
32 
33  template <class T>
34  struct ComplexComparesAbs<std::complex<T> >
35  {
36  inline static bool less(const std::complex<T>& l,
37  const std::complex<T>& r)
38  {return std::abs(l) < std::abs(r);}
39 
40  inline static bool more(const std::complex<T>& l,
41  const std::complex<T>& r)
42  {return std::abs(l) > std::abs(l);}
43  };
44 }
45 
46 #endif // NPSTAT_COMPLEXCOMPARESABS_HH_
47 
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