Xped
Loading...
Searching...
No Matches
ScalarTraits.hpp
Go to the documentation of this file.
1#ifndef XPED_SCALAR_TRAITS_H_
2#define XPED_SCALAR_TRAITS_H_
3
4#include <complex>
5
6namespace Xped {
7
8template <typename Scalar>
10{};
11
12template <>
13struct ScalarTraits<double>
14{
15 typedef double Real;
16 typedef std::complex<double> Comp;
17 static inline double epsilon() { return 1.e-12; }
18 static constexpr bool IS_COMPLEX() { return false; }
19};
20
21template <typename RealScalar_>
22struct ScalarTraits<std::complex<RealScalar_>>
23{
24 typedef RealScalar_ Real;
25 typedef std::complex<RealScalar_> Comp;
26 static inline Real epsilon() { return static_cast<Real>(1.e-12); }
27 static constexpr bool IS_COMPLEX() { return true; }
28};
29
30} // namespace Xped
31#endif
Definition: bench.cpp:62
static double epsilon()
Definition: ScalarTraits.hpp:17
static constexpr bool IS_COMPLEX()
Definition: ScalarTraits.hpp:18
double Real
Definition: ScalarTraits.hpp:15
std::complex< double > Comp
Definition: ScalarTraits.hpp:16
Definition: ScalarTraits.hpp:10