Lines Matching refs:imag

30     T imag() const; // constexpr in C++14
33 void imag(T);
61 constexpr float imag() const;
62 void imag(float);
90 constexpr double imag() const;
91 void imag(double);
119 constexpr long double imag() const;
120 void imag(long double);
173 template<class T> T imag(const complex<T>&); // constexpr in C++14
174 long double imag(long double); // constexpr in C++14
175 double imag(double); // constexpr in C++14
176 template<Integral T> double imag(T); // constexpr in C++14
177 float imag(float); // constexpr in C++14
270 : __re_(__c.real()), __im_(__c.imag()) {}
273 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 value_type imag() const {return __im_;}
276 _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
288 __im_ = __c.imag();
294 __im_ += __c.imag();
300 __im_ -= __c.imag();
305 *this = *this * complex(__c.real(), __c.imag());
310 *this = *this / complex(__c.real(), __c.imag());
334 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR float imag() const {return __im_;}
337 _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
349 __im_ = __c.imag();
355 __im_ += __c.imag();
361 __im_ -= __c.imag();
366 *this = *this * complex(__c.real(), __c.imag());
371 *this = *this / complex(__c.real(), __c.imag());
392 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR double imag() const {return __im_;}
395 _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
407 __im_ = __c.imag();
413 __im_ += __c.imag();
419 __im_ -= __c.imag();
424 *this = *this * complex(__c.real(), __c.imag());
429 *this = *this / complex(__c.real(), __c.imag());
450 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR long double imag() const {return __im_;}
453 _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
465 __im_ = __c.imag();
471 __im_ += __c.imag();
477 __im_ -= __c.imag();
482 *this = *this * complex(__c.real(), __c.imag());
487 *this = *this / complex(__c.real(), __c.imag());
495 : __re_(__c.real()), __im_(__c.imag()) {}
500 : __re_(__c.real()), __im_(__c.imag()) {}
505 : __re_(__c.real()), __im_(__c.imag()) {}
510 : __re_(__c.real()), __im_(__c.imag()) {}
515 : __re_(__c.real()), __im_(__c.imag()) {}
520 : __re_(__c.real()), __im_(__c.imag()) {}
589 _Tp __b = __z.imag();
591 _Tp __d = __w.imag();
669 _Tp __b = __z.imag();
671 _Tp __d = __w.imag();
712 return complex<_Tp>(__x.real() / __y, __x.imag() / __y);
738 return complex<_Tp>(-__x.real(), -__x.imag());
746 return __x.real() == __y.real() && __x.imag() == __y.imag();
754 return __x.real() == __y && __x.imag() == 0;
762 return __x == __y.real() && 0 == __y.imag();
830 // imag
835 imag(const complex<_Tp>& __c)
837 return __c.imag();
843 imag(_Tp)
855 return hypot(__c.real(), __c.imag());
865 return atan2(__c.imag(), __c.real());
911 if (__libcpp_isinf_or_builtin(__c.imag()))
912 return abs(__c.imag());
913 return __c.real() * __c.real() + __c.imag() * __c.imag();
932 return complex<_Tp>(__c.real(), -__c.imag());
954 if (__libcpp_isinf_or_builtin(__c.real()) || __libcpp_isinf_or_builtin(__c.imag()))
955 __r = complex<_Tp>(INFINITY, copysign(_Tp(0), __c.imag()));
1041 if (__libcpp_isinf_or_builtin(__x.imag()))
1042 return complex<_Tp>(_Tp(INFINITY), __x.imag());
1046 …plex<_Tp>(__x.real(), __libcpp_isnan_or_builtin(__x.imag()) ? __x.imag() : copysign(_Tp(0), __x.im…
1047 …rn complex<_Tp>(__libcpp_isnan_or_builtin(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real(), …
1058 _Tp __i = __x.imag();
1073 else if (__libcpp_isnan_or_builtin(__x.real()) && __x.imag() == 0)
1131 return complex<_Tp>((__x.real() - __x.imag()) * (__x.real() + __x.imag()),
1132 _Tp(2) * __x.real() * __x.imag());
1144 if (__libcpp_isnan_or_builtin(__x.imag()))
1146 if (__libcpp_isinf_or_builtin(__x.imag()))
1147 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1148 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1152 if (__libcpp_isinf_or_builtin(__x.imag()))
1153 return complex<_Tp>(__x.imag(), __x.real());
1154 if (__x.imag() == 0)
1158 if (__libcpp_isinf_or_builtin(__x.imag()))
1159 return complex<_Tp>(copysign(__x.imag(), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1161 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1173 if (__libcpp_isnan_or_builtin(__x.imag()))
1174 return complex<_Tp>(abs(__x.real()), __x.imag());
1175 if (__libcpp_isinf_or_builtin(__x.imag()))
1178 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1180 return complex<_Tp>(-__x.real(), copysign(__pi * _Tp(0.75), __x.imag()));
1183 return complex<_Tp>(-__x.real(), copysign(__pi, __x.imag()));
1184 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1188 if (__libcpp_isinf_or_builtin(__x.imag()))
1189 return complex<_Tp>(abs(__x.imag()), __x.real());
1192 if (__libcpp_isinf_or_builtin(__x.imag()))
1193 return complex<_Tp>(abs(__x.imag()), copysign(__pi/_Tp(2), __x.imag()));
1195 return complex<_Tp>(copysign(__z.real(), _Tp(0)), copysign(__z.imag(), __x.imag()));
1205 if (__libcpp_isinf_or_builtin(__x.imag()))
1207 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1209 if (__libcpp_isnan_or_builtin(__x.imag()))
1212 return complex<_Tp>(copysign(_Tp(0), __x.real()), __x.imag());
1213 return complex<_Tp>(__x.imag(), __x.imag());
1221 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1223 if (abs(__x.real()) == _Tp(1) && __x.imag() == _Tp(0))
1225 return complex<_Tp>(copysign(_Tp(INFINITY), __x.real()), copysign(_Tp(0), __x.imag()));
1228 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1237 if (__libcpp_isinf_or_builtin(__x.real()) && !__libcpp_isfinite_or_builtin(__x.imag()))
1239 if (__x.real() == 0 && !__libcpp_isfinite_or_builtin(__x.imag()))
1241 if (__x.imag() == 0 && !__libcpp_isfinite_or_builtin(__x.real()))
1243 return complex<_Tp>(sinh(__x.real()) * cos(__x.imag()), cosh(__x.real()) * sin(__x.imag()));
1252 if (__libcpp_isinf_or_builtin(__x.real()) && !__libcpp_isfinite_or_builtin(__x.imag()))
1254 if (__x.real() == 0 && !__libcpp_isfinite_or_builtin(__x.imag()))
1256 if (__x.real() == 0 && __x.imag() == 0)
1257 return complex<_Tp>(_Tp(1), __x.imag());
1258 if (__x.imag() == 0 && !__libcpp_isfinite_or_builtin(__x.real()))
1259 return complex<_Tp>(abs(__x.real()), __x.imag());
1260 return complex<_Tp>(cosh(__x.real()) * cos(__x.imag()), sinh(__x.real()) * sin(__x.imag()));
1271 if (!__libcpp_isfinite_or_builtin(__x.imag()))
1273 return complex<_Tp>(_Tp(1), copysign(_Tp(0), sin(_Tp(2) * __x.imag())));
1275 if (__libcpp_isnan_or_builtin(__x.real()) && __x.imag() == 0)
1278 _Tp __2i(_Tp(2) * __x.imag());
1293 complex<_Tp> __z = asinh(complex<_Tp>(-__x.imag(), __x.real()));
1294 return complex<_Tp>(__z.imag(), -__z.real());
1306 if (__libcpp_isnan_or_builtin(__x.imag()))
1307 return complex<_Tp>(__x.imag(), __x.real());
1308 if (__libcpp_isinf_or_builtin(__x.imag()))
1311 return complex<_Tp>(_Tp(0.75) * __pi, -__x.imag());
1312 return complex<_Tp>(_Tp(0.25) * __pi, -__x.imag());
1315 return complex<_Tp>(__pi, signbit(__x.imag()) ? -__x.real() : __x.real());
1316 return complex<_Tp>(_Tp(0), signbit(__x.imag()) ? __x.real() : -__x.real());
1320 if (__libcpp_isinf_or_builtin(__x.imag()))
1321 return complex<_Tp>(__x.real(), -__x.imag());
1324 if (__libcpp_isinf_or_builtin(__x.imag()))
1325 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1326 if (__x.real() == 0 && (__x.imag() == 0 || isnan(__x.imag())))
1327 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1329 if (signbit(__x.imag()))
1330 return complex<_Tp>(abs(__z.imag()), abs(__z.real()));
1331 return complex<_Tp>(abs(__z.imag()), -abs(__z.real()));
1340 complex<_Tp> __z = atanh(complex<_Tp>(-__x.imag(), __x.real()));
1341 return complex<_Tp>(__z.imag(), -__z.real());
1350 complex<_Tp> __z = sinh(complex<_Tp>(-__x.imag(), __x.real()));
1351 return complex<_Tp>(__z.imag(), -__z.real());
1361 return cosh(complex<_Tp>(-__x.imag(), __x.real()));
1370 complex<_Tp> __z = tanh(complex<_Tp>(-__x.imag(), __x.real()));
1371 return complex<_Tp>(__z.imag(), -__z.real());
1445 __s << '(' << __x.real() << ',' << __x.imag() << ')';