File indexing completed on 2024-04-06 12:19:22
0001 #ifndef NPSTAT_PRECISETYPE_HH_
0002 #define NPSTAT_PRECISETYPE_HH_
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include <complex>
0015
0016 #include "Alignment/Geners/interface/IOIsNumber.hh"
0017
0018 namespace npstat {
0019 template <class T, int I = 0>
0020 struct PreciseTypeHelper {
0021 typedef T type;
0022 };
0023
0024 template <class T>
0025 struct PreciseTypeHelper<T, 1> {
0026 typedef long double type;
0027 };
0028
0029
0030
0031
0032
0033
0034 template <class T>
0035 struct PreciseType {
0036 typedef typename PreciseTypeHelper<T, gs::IOIsNumber<T>::value>::type type;
0037 };
0038
0039 template <class T>
0040 struct PreciseType<std::complex<T> > {
0041 typedef std::complex<long double> type;
0042 };
0043
0044 template <class T>
0045 struct PreciseType<const std::complex<T> > {
0046 typedef std::complex<long double> type;
0047 };
0048
0049 template <class T>
0050 struct PreciseType<volatile std::complex<T> > {
0051 typedef std::complex<long double> type;
0052 };
0053
0054 template <class T>
0055 struct PreciseType<const volatile std::complex<T> > {
0056 typedef std::complex<long double> type;
0057 };
0058 }
0059
0060 #endif