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
271 : __re_(__c.real()), __im_(__c.imag()) {}
274 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 value_type imag() const {return __im_;}
277 _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
289 __im_ = __c.imag();
295 __im_ += __c.imag();
301 __im_ -= __c.imag();
306 *this = *this * complex(__c.real(), __c.imag());
311 *this = *this / complex(__c.real(), __c.imag());
335 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR float imag() const {return __im_;}
338 _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
350 __im_ = __c.imag();
356 __im_ += __c.imag();
362 __im_ -= __c.imag();
367 *this = *this * complex(__c.real(), __c.imag());
372 *this = *this / complex(__c.real(), __c.imag());
393 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR double imag() const {return __im_;}
396 _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
408 __im_ = __c.imag();
414 __im_ += __c.imag();
420 __im_ -= __c.imag();
425 *this = *this * complex(__c.real(), __c.imag());
430 *this = *this / complex(__c.real(), __c.imag());
451 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR long double imag() const {return __im_;}
454 _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
466 __im_ = __c.imag();
472 __im_ += __c.imag();
478 __im_ -= __c.imag();
483 *this = *this * complex(__c.real(), __c.imag());
488 *this = *this / complex(__c.real(), __c.imag());
496 : __re_(__c.real()), __im_(__c.imag()) {}
501 : __re_(__c.real()), __im_(__c.imag()) {}
506 : __re_(__c.real()), __im_(__c.imag()) {}
511 : __re_(__c.real()), __im_(__c.imag()) {}
516 : __re_(__c.real()), __im_(__c.imag()) {}
521 : __re_(__c.real()), __im_(__c.imag()) {}
590 _Tp __b = __z.imag();
592 _Tp __d = __w.imag();
670 _Tp __b = __z.imag();
672 _Tp __d = __w.imag();
713 return complex<_Tp>(__x.real() / __y, __x.imag() / __y);
739 return complex<_Tp>(-__x.real(), -__x.imag());
747 return __x.real() == __y.real() && __x.imag() == __y.imag();
755 return __x.real() == __y && __x.imag() == 0;
763 return __x == __y.real() && 0 == __y.imag();
831 // imag
836 imag(const complex<_Tp>& __c)
838 return __c.imag();
844 imag(_Tp)
856 return hypot(__c.real(), __c.imag());
866 return atan2(__c.imag(), __c.real());
912 if (__libcpp_isinf_or_builtin(__c.imag()))
913 return abs(__c.imag());
914 return __c.real() * __c.real() + __c.imag() * __c.imag();
933 return complex<_Tp>(__c.real(), -__c.imag());
955 if (__libcpp_isinf_or_builtin(__c.real()) || __libcpp_isinf_or_builtin(__c.imag()))
956 __r = complex<_Tp>(INFINITY, copysign(_Tp(0), __c.imag()));
1042 if (__libcpp_isinf_or_builtin(__x.imag()))
1043 return complex<_Tp>(_Tp(INFINITY), __x.imag());
1047 …plex<_Tp>(__x.real(), __libcpp_isnan_or_builtin(__x.imag()) ? __x.imag() : copysign(_Tp(0), __x.im…
1048 …rn complex<_Tp>(__libcpp_isnan_or_builtin(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real(), …
1059 _Tp __i = __x.imag();
1061 return complex<_Tp>(exp(__x.real()), copysign(_Tp(0), __x.imag()));
1133 return complex<_Tp>((__x.real() - __x.imag()) * (__x.real() + __x.imag()),
1134 _Tp(2) * __x.real() * __x.imag());
1146 if (__libcpp_isnan_or_builtin(__x.imag()))
1148 if (__libcpp_isinf_or_builtin(__x.imag()))
1149 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1150 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1154 if (__libcpp_isinf_or_builtin(__x.imag()))
1155 return complex<_Tp>(__x.imag(), __x.real());
1156 if (__x.imag() == 0)
1160 if (__libcpp_isinf_or_builtin(__x.imag()))
1161 return complex<_Tp>(copysign(__x.imag(), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1163 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1175 if (__libcpp_isnan_or_builtin(__x.imag()))
1176 return complex<_Tp>(abs(__x.real()), __x.imag());
1177 if (__libcpp_isinf_or_builtin(__x.imag()))
1180 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1182 return complex<_Tp>(-__x.real(), copysign(__pi * _Tp(0.75), __x.imag()));
1185 return complex<_Tp>(-__x.real(), copysign(__pi, __x.imag()));
1186 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1190 if (__libcpp_isinf_or_builtin(__x.imag()))
1191 return complex<_Tp>(abs(__x.imag()), __x.real());
1194 if (__libcpp_isinf_or_builtin(__x.imag()))
1195 return complex<_Tp>(abs(__x.imag()), copysign(__pi/_Tp(2), __x.imag()));
1197 return complex<_Tp>(copysign(__z.real(), _Tp(0)), copysign(__z.imag(), __x.imag()));
1207 if (__libcpp_isinf_or_builtin(__x.imag()))
1209 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1211 if (__libcpp_isnan_or_builtin(__x.imag()))
1214 return complex<_Tp>(copysign(_Tp(0), __x.real()), __x.imag());
1215 return complex<_Tp>(__x.imag(), __x.imag());
1223 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1225 if (abs(__x.real()) == _Tp(1) && __x.imag() == _Tp(0))
1227 return complex<_Tp>(copysign(_Tp(INFINITY), __x.real()), copysign(_Tp(0), __x.imag()));
1230 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1239 if (__libcpp_isinf_or_builtin(__x.real()) && !__libcpp_isfinite_or_builtin(__x.imag()))
1241 if (__x.real() == 0 && !__libcpp_isfinite_or_builtin(__x.imag()))
1243 if (__x.imag() == 0 && !__libcpp_isfinite_or_builtin(__x.real()))
1245 return complex<_Tp>(sinh(__x.real()) * cos(__x.imag()), cosh(__x.real()) * sin(__x.imag()));
1254 if (__libcpp_isinf_or_builtin(__x.real()) && !__libcpp_isfinite_or_builtin(__x.imag()))
1256 if (__x.real() == 0 && !__libcpp_isfinite_or_builtin(__x.imag()))
1258 if (__x.real() == 0 && __x.imag() == 0)
1259 return complex<_Tp>(_Tp(1), __x.imag());
1260 if (__x.imag() == 0 && !__libcpp_isfinite_or_builtin(__x.real()))
1261 return complex<_Tp>(abs(__x.real()), __x.imag());
1262 return complex<_Tp>(cosh(__x.real()) * cos(__x.imag()), sinh(__x.real()) * sin(__x.imag()));
1273 if (!__libcpp_isfinite_or_builtin(__x.imag()))
1275 … return complex<_Tp>(copysign(_Tp(1), __x.real()), copysign(_Tp(0), sin(_Tp(2) * __x.imag())));
1277 if (__libcpp_isnan_or_builtin(__x.real()) && __x.imag() == 0)
1280 _Tp __2i(_Tp(2) * __x.imag());
1295 complex<_Tp> __z = asinh(complex<_Tp>(-__x.imag(), __x.real()));
1296 return complex<_Tp>(__z.imag(), -__z.real());
1308 if (__libcpp_isnan_or_builtin(__x.imag()))
1309 return complex<_Tp>(__x.imag(), __x.real());
1310 if (__libcpp_isinf_or_builtin(__x.imag()))
1313 return complex<_Tp>(_Tp(0.75) * __pi, -__x.imag());
1314 return complex<_Tp>(_Tp(0.25) * __pi, -__x.imag());
1317 return complex<_Tp>(__pi, signbit(__x.imag()) ? -__x.real() : __x.real());
1318 return complex<_Tp>(_Tp(0), signbit(__x.imag()) ? __x.real() : -__x.real());
1322 if (__libcpp_isinf_or_builtin(__x.imag()))
1323 return complex<_Tp>(__x.real(), -__x.imag());
1326 if (__libcpp_isinf_or_builtin(__x.imag()))
1327 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1328 if (__x.real() == 0 && (__x.imag() == 0 || isnan(__x.imag())))
1329 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1331 if (signbit(__x.imag()))
1332 return complex<_Tp>(abs(__z.imag()), abs(__z.real()));
1333 return complex<_Tp>(abs(__z.imag()), -abs(__z.real()));
1342 complex<_Tp> __z = atanh(complex<_Tp>(-__x.imag(), __x.real()));
1343 return complex<_Tp>(__z.imag(), -__z.real());
1352 complex<_Tp> __z = sinh(complex<_Tp>(-__x.imag(), __x.real()));
1353 return complex<_Tp>(__z.imag(), -__z.real());
1363 return cosh(complex<_Tp>(-__x.imag(), __x.real()));
1372 complex<_Tp> __z = tanh(complex<_Tp>(-__x.imag(), __x.real()));
1373 return complex<_Tp>(__z.imag(), -__z.real());
1447 __s << '(' << __x.real() << ',' << __x.imag() << ')';