STIR  6.2.0
HigherPrecision.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2024, University College London
3  This file is part of STIR.
4 
5  SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
6 
7  See STIR/LICENSE.txt for details
8 */
16 #ifndef __stir_HigherPrecision__H__
17 #define __stir_HigherPrecision__H__
18 
19 #include "stir/common.h"
20 #include <complex>
21 
22 START_NAMESPACE_STIR
23 
25 
29 template <class T>
31 {
32  typedef T type;
33 };
34 
35 template <>
36 struct HigherPrecision<float>
37 {
38  typedef double type;
39 };
40 
41 template <>
42 struct HigherPrecision<double>
43 {
44  typedef long double type;
45 };
46 
47 template <class T>
48 struct HigherPrecision<std::complex<T>>
49 {
50  typedef std::complex<typename HigherPrecision<T>::type> type;
51 };
52 
53 END_NAMESPACE_STIR
54 
55 #endif
basic configuration include file
Helper class to get a type with higher precision.
Definition: HigherPrecision.h:30