npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
PairCompareQ.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_PAIRCOMPAREQ_HH_
2 #define NPSTAT_PAIRCOMPAREQ_HH_
3 
4 /*!
5 // \file PairCompareQ.hh
6 //
7 // \brief Comparison functors for quadruple precision pairs
8 //
9 // Author: I. Volobouev
10 //
11 // July 2023
12 */
13 
14 #include "npstat/nm/quad_float.hh"
15 
16 namespace npstat {
17  template <typename T>
19  {
20  inline bool operator()(const T& x, const T& y) const
21  {return fabsq(x.first) < fabsq(y.first);}
22  inline bool operator()(const T* x, const T* y) const
23  {return fabsq(x->first) < fabsq(y->first);}
24  };
25 
26  /** "greater" functor to compare the magnitude of the first element only */
27  template <typename T>
29  {
30  inline bool operator()(const T& x, const T& y) const
31  {return fabsq(y.first) < fabsq(x.first);}
32  inline bool operator()(const T* x, const T* y) const
33  {return fabsq(y->first) < fabsq(x->first);}
34  };
35 }
36 
37 #endif // NPSTAT_PAIRCOMPAREQ_HH_
Definition: AbsArrayProjector.hh:14
Basic header to include for quadruple precision calculations.
Definition: PairCompareQ.hh:29
Definition: PairCompareQ.hh:19