SST 16.0.0
Structural Simulation Toolkit
sst_complex.h
1// Copyright 2009-2026 NTESS. Under the terms
2// of Contract DE-NA0003525 with NTESS, the U.S.
3// Government retains certain rights in this software.
4//
5// Copyright (c) 2009-2026, NTESS
6// All rights reserved.
7//
8// This file is part of the SST software package. For license
9// information, see the LICENSE file in the top level directory of the
10// distribution.
11
12#ifndef SST_CORE_COMPLEX_H
13#define SST_CORE_COMPLEX_H
14
15#include <cfloat>
16#include <complex>
17
18namespace SST::Core {
19
20// Traits for getting information about complex types
21template <class T>
23{
24 static constexpr bool is_complex = false;
25 using real_t = void;
26};
27
28template <class T>
29struct complex_properties<std::complex<T>>
30{
31 static constexpr bool is_complex = true;
32 using real_t = T;
33};
34
35#ifndef __STDC_NO_COMPLEX__
36
37template <>
38struct complex_properties<float _Complex>
39{
40 static constexpr bool is_complex = true;
41 using real_t = float;
42};
43
44template <>
45struct complex_properties<double _Complex>
46{
47 static constexpr bool is_complex = true;
48 using real_t = double;
49};
50
51template <>
52struct complex_properties<long double _Complex>
53{
54
55 static constexpr bool is_complex = true;
56 using real_t = long double;
57};
58
59#endif // __STDC_NO_COMPLEX__
60
61} // namespace SST::Core
62
63#endif // SST_CORE_COMPLEX_H
Definition sst_complex.h:23