11#ifndef TLAPACK_TEST_COMPLEX_HH
12#define TLAPACK_TEST_COMPLEX_HH
21 : std::complex<T>(
r, i)
29 (std::complex<T>&)(*
this) =
x;
37 *
this = std::numeric_limits<T>::quiet_NaN();
38 else if (
isnan(*
this))
39 *
this = std::numeric_limits<T>::signaling_NaN();
41 (std::complex<T>&)(*this) +=
x;
50 *
this = std::numeric_limits<T>::quiet_NaN();
51 else if (
isnan(*
this))
52 *
this = std::numeric_limits<T>::signaling_NaN();
54 (std::complex<T>&)(*this) -=
x;
63 *
this = std::numeric_limits<T>::quiet_NaN();
64 else if (
isnan(*
this))
65 *
this = std::numeric_limits<T>::signaling_NaN();
67 (std::complex<T>&)(*this) *=
x;
74 (std::complex<T>&)(*
this) *=
x;
82 *
this = std::numeric_limits<T>::quiet_NaN();
83 else if (
isnan(*
this))
84 *
this = std::numeric_limits<T>::signaling_NaN();
86 (std::complex<T>&)(*this) /=
x;
93 (std::complex<T>&)(*
this) /=
x;
216 return std::numeric_limits<T>::quiet_NaN();
218 return std::numeric_limits<T>::infinity();
220 return abs((
const std::complex<T>&)
x);
225 return conj((
const std::complex<T>&)
x);
230 template <
typename T>
234 template <
typename T>
constexpr bool isnan(const T &x) noexcept
Extends std::isnan() to complex numbers.
Definition utils.hpp:125
constexpr real_type< T > real(const T &x) noexcept
Extends std::real() to real datatypes.
Definition utils.hpp:71
constexpr real_type< T > imag(const T &x) noexcept
Extends std::imag() to real datatypes.
Definition utils.hpp:86
constexpr bool isinf(const T &x) noexcept
Extends std::isinf() to complex numbers.
Definition utils.hpp:117
typename traits::real_type_traits< Types..., int >::type real_type
The common real type of the list of types.
Definition scalar_type_traits.hpp:113
Definition NaNPropagComplex.hpp:19
friend T abs(const NaNPropagComplex &x)
2-norm absolute value, sqrt( |Re(x)|^2 + |Im(x)|^2 )
Definition NaNPropagComplex.hpp:213
Complex type traits for the list of types Types.
Definition scalar_type_traits.hpp:145
Real type traits for the list of types Types.
Definition scalar_type_traits.hpp:71