STIR 6.4.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
22START_NAMESPACE_STIR
23
25
29template <class T>
31{
32 typedef T type;
33};
34
35template <>
36struct HigherPrecision<float>
37{
38 typedef double type;
39};
40
41template <>
42struct HigherPrecision<double>
43{
44 typedef long double type;
45};
46
47template <class T>
48struct HigherPrecision<std::complex<T>>
49{
50 typedef std::complex<typename HigherPrecision<T>::type> type;
51};
52
53END_NAMESPACE_STIR
54
55#endif
basic configuration include file
Helper class to get a type with higher precision.
Definition HigherPrecision.h:31