Lines Matching refs:imag
31 T imag() const; // constexpr in C++14
34 void imag(T);
62 constexpr float imag() const;
63 void imag(float);
91 constexpr double imag() const;
92 void imag(double);
120 constexpr long double imag() const;
121 void imag(long double);
174 template<class T> T imag(const complex<T>&); // constexpr in C++14
175 long double imag(long double); // constexpr in C++14
176 double imag(double); // constexpr in C++14
177 template<Integral T> double imag(T); // constexpr in C++14
178 float imag(float); // constexpr in C++14
274 : __re_(__c.real()), __im_(__c.imag()) {}
277 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 value_type imag() const {return __im_;}
280 _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
292 __im_ = __c.imag();
298 __im_ += __c.imag();
304 __im_ -= __c.imag();
309 *this = *this * complex(__c.real(), __c.imag());
314 *this = *this / complex(__c.real(), __c.imag());
338 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR float imag() const {return __im_;}
341 _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
353 __im_ = __c.imag();
359 __im_ += __c.imag();
365 __im_ -= __c.imag();
370 *this = *this * complex(__c.real(), __c.imag());
375 *this = *this / complex(__c.real(), __c.imag());
396 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR double imag() const {return __im_;}
399 _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
411 __im_ = __c.imag();
417 __im_ += __c.imag();
423 __im_ -= __c.imag();
428 *this = *this * complex(__c.real(), __c.imag());
433 *this = *this / complex(__c.real(), __c.imag());
454 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR long double imag() const {return __im_;}
457 _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
469 __im_ = __c.imag();
475 __im_ += __c.imag();
481 __im_ -= __c.imag();
486 *this = *this * complex(__c.real(), __c.imag());
491 *this = *this / complex(__c.real(), __c.imag());
499 : __re_(__c.real()), __im_(__c.imag()) {}
504 : __re_(__c.real()), __im_(__c.imag()) {}
509 : __re_(__c.real()), __im_(__c.imag()) {}
514 : __re_(__c.real()), __im_(__c.imag()) {}
519 : __re_(__c.real()), __im_(__c.imag()) {}
524 : __re_(__c.real()), __im_(__c.imag()) {}
593 _Tp __b = __z.imag();
595 _Tp __d = __w.imag();
673 _Tp __b = __z.imag();
675 _Tp __d = __w.imag();
716 return complex<_Tp>(__x.real() / __y, __x.imag() / __y);
742 return complex<_Tp>(-__x.real(), -__x.imag());
750 return __x.real() == __y.real() && __x.imag() == __y.imag();
758 return __x.real() == __y && __x.imag() == 0;
766 return __x == __y.real() && 0 == __y.imag();
834 // imag
839 imag(const complex<_Tp>& __c)
841 return __c.imag();
847 imag(_Tp)
859 return hypot(__c.real(), __c.imag());
869 return atan2(__c.imag(), __c.real());
915 if (__libcpp_isinf(__c.imag()))
916 return abs(__c.imag());
917 return __c.real() * __c.real() + __c.imag() * __c.imag();
936 return complex<_Tp>(__c.real(), -__c.imag());
958 if (__libcpp_isinf(__c.real()) || __libcpp_isinf(__c.imag()))
959 __r = complex<_Tp>(INFINITY, copysign(_Tp(0), __c.imag()));
1045 if (__libcpp_isinf(__x.imag()))
1046 return complex<_Tp>(_Tp(INFINITY), __x.imag());
1050 …return complex<_Tp>(__x.real(), __libcpp_isnan(__x.imag()) ? __x.imag() : copysign(_Tp(0), __x.ima…
1051 …return complex<_Tp>(__libcpp_isnan(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real(), __x.ima…
1062 _Tp __i = __x.imag();
1077 else if (__libcpp_isnan(__x.real()) && __x.imag() == 0)
1137 if (__libcpp_isnan(__x.imag()))
1139 if (__libcpp_isinf(__x.imag()))
1140 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1141 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1145 if (__libcpp_isinf(__x.imag()))
1146 return complex<_Tp>(__x.imag(), __x.real());
1147 if (__x.imag() == 0)
1151 if (__libcpp_isinf(__x.imag()))
1152 return complex<_Tp>(copysign(__x.imag(), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1154 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1166 if (__libcpp_isnan(__x.imag()))
1167 return complex<_Tp>(abs(__x.real()), __x.imag());
1168 if (__libcpp_isinf(__x.imag()))
1171 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1173 return complex<_Tp>(-__x.real(), copysign(__pi * _Tp(0.75), __x.imag()));
1176 return complex<_Tp>(-__x.real(), copysign(__pi, __x.imag()));
1177 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1181 if (__libcpp_isinf(__x.imag()))
1182 return complex<_Tp>(abs(__x.imag()), __x.real());
1185 if (__libcpp_isinf(__x.imag()))
1186 return complex<_Tp>(abs(__x.imag()), copysign(__pi/_Tp(2), __x.imag()));
1188 return complex<_Tp>(copysign(__z.real(), _Tp(0)), copysign(__z.imag(), __x.imag()));
1198 if (__libcpp_isinf(__x.imag()))
1200 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1202 if (__libcpp_isnan(__x.imag()))
1205 return complex<_Tp>(copysign(_Tp(0), __x.real()), __x.imag());
1206 return complex<_Tp>(__x.imag(), __x.imag());
1214 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1216 if (abs(__x.real()) == _Tp(1) && __x.imag() == _Tp(0))
1218 return complex<_Tp>(copysign(_Tp(INFINITY), __x.real()), copysign(_Tp(0), __x.imag()));
1221 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1230 if (__libcpp_isinf(__x.real()) && !__libcpp_isfinite(__x.imag()))
1232 if (__x.real() == 0 && !__libcpp_isfinite(__x.imag()))
1234 if (__x.imag() == 0 && !__libcpp_isfinite(__x.real()))
1236 return complex<_Tp>(sinh(__x.real()) * cos(__x.imag()), cosh(__x.real()) * sin(__x.imag()));
1245 if (__libcpp_isinf(__x.real()) && !__libcpp_isfinite(__x.imag()))
1247 if (__x.real() == 0 && !__libcpp_isfinite(__x.imag()))
1249 if (__x.real() == 0 && __x.imag() == 0)
1250 return complex<_Tp>(_Tp(1), __x.imag());
1251 if (__x.imag() == 0 && !__libcpp_isfinite(__x.real()))
1252 return complex<_Tp>(abs(__x.real()), __x.imag());
1253 return complex<_Tp>(cosh(__x.real()) * cos(__x.imag()), sinh(__x.real()) * sin(__x.imag()));
1264 if (!__libcpp_isfinite(__x.imag()))
1266 return complex<_Tp>(_Tp(1), copysign(_Tp(0), sin(_Tp(2) * __x.imag())));
1268 if (__libcpp_isnan(__x.real()) && __x.imag() == 0)
1271 _Tp __2i(_Tp(2) * __x.imag());
1286 complex<_Tp> __z = asinh(complex<_Tp>(-__x.imag(), __x.real()));
1287 return complex<_Tp>(__z.imag(), -__z.real());
1299 if (__libcpp_isnan(__x.imag()))
1300 return complex<_Tp>(__x.imag(), __x.real());
1301 if (__libcpp_isinf(__x.imag()))
1304 return complex<_Tp>(_Tp(0.75) * __pi, -__x.imag());
1305 return complex<_Tp>(_Tp(0.25) * __pi, -__x.imag());
1308 return complex<_Tp>(__pi, signbit(__x.imag()) ? -__x.real() : __x.real());
1309 return complex<_Tp>(_Tp(0), signbit(__x.imag()) ? __x.real() : -__x.real());
1313 if (__libcpp_isinf(__x.imag()))
1314 return complex<_Tp>(__x.real(), -__x.imag());
1317 if (__libcpp_isinf(__x.imag()))
1318 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1319 if (__x.real() == 0 && (__x.imag() == 0 || isnan(__x.imag())))
1320 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1322 if (signbit(__x.imag()))
1323 return complex<_Tp>(abs(__z.imag()), abs(__z.real()));
1324 return complex<_Tp>(abs(__z.imag()), -abs(__z.real()));
1333 complex<_Tp> __z = atanh(complex<_Tp>(-__x.imag(), __x.real()));
1334 return complex<_Tp>(__z.imag(), -__z.real());
1343 complex<_Tp> __z = sinh(complex<_Tp>(-__x.imag(), __x.real()));
1344 return complex<_Tp>(__z.imag(), -__z.real());
1354 return cosh(complex<_Tp>(-__x.imag(), __x.real()));
1363 complex<_Tp> __z = tanh(complex<_Tp>(-__x.imag(), __x.real()));
1364 return complex<_Tp>(__z.imag(), -__z.real());
1437 __s << '(' << __x.real() << ',' << __x.imag() << ')';