Lines Matching refs:complex
55 template<typename _Tp> class complex;
56 template<> class complex<float>;
57 template<> class complex<double>;
58 template<> class complex<long double>;
61 template<typename _Tp> _Tp abs(const complex<_Tp>&);
63 template<typename _Tp> _Tp arg(const complex<_Tp>&);
65 template<typename _Tp> _Tp norm(const complex<_Tp>&);
68 template<typename _Tp> complex<_Tp> conj(const complex<_Tp>&);
70 template<typename _Tp> complex<_Tp> polar(const _Tp&, const _Tp& = 0);
74 template<typename _Tp> complex<_Tp> cos(const complex<_Tp>&);
76 template<typename _Tp> complex<_Tp> cosh(const complex<_Tp>&);
78 template<typename _Tp> complex<_Tp> exp(const complex<_Tp>&);
80 template<typename _Tp> complex<_Tp> log(const complex<_Tp>&);
82 template<typename _Tp> complex<_Tp> log10(const complex<_Tp>&);
84 template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, int);
86 template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, const _Tp&);
88 template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&,
89 const complex<_Tp>&);
91 template<typename _Tp> complex<_Tp> pow(const _Tp&, const complex<_Tp>&);
93 template<typename _Tp> complex<_Tp> sin(const complex<_Tp>&);
95 template<typename _Tp> complex<_Tp> sinh(const complex<_Tp>&);
97 template<typename _Tp> complex<_Tp> sqrt(const complex<_Tp>&);
99 template<typename _Tp> complex<_Tp> tan(const complex<_Tp>&);
101 template<typename _Tp> complex<_Tp> tanh(const complex<_Tp>&);
115 struct complex struct
122 complex(const _Tp& = _Tp(), const _Tp & = _Tp()); argument
128 complex(const complex<_Up>&);
140 complex<_Tp>& operator=(const _Tp&); argument
142 complex<_Tp>& operator+=(const _Tp&);
144 complex<_Tp>& operator-=(const _Tp&);
146 complex<_Tp>& operator*=(const _Tp&);
148 complex<_Tp>& operator/=(const _Tp&);
155 complex<_Tp>& operator=(const complex<_Up>&); argument
158 complex<_Tp>& operator+=(const complex<_Up>&);
161 complex<_Tp>& operator-=(const complex<_Up>&);
164 complex<_Tp>& operator*=(const complex<_Up>&);
167 complex<_Tp>& operator/=(const complex<_Up>&);
169 const complex& __rep() const;
178 complex<_Tp>::real() { return _M_real; } in real() argument
182 complex<_Tp>::real() const { return _M_real; } in real()
186 complex<_Tp>::imag() { return _M_imag; } in imag()
190 complex<_Tp>::imag() const { return _M_imag; } in imag()
194 complex<_Tp>::complex(const _Tp& __r, const _Tp& __i) in complex() function
200 complex<_Tp>::complex(const complex<_Up>& __z) in complex() function
204 complex<_Tp>&
205 complex<_Tp>::operator=(const _Tp& __t)
214 inline complex<_Tp>&
215 complex<_Tp>::operator+=(const _Tp& __t)
223 inline complex<_Tp>&
224 complex<_Tp>::operator-=(const _Tp& __t)
232 complex<_Tp>&
233 complex<_Tp>::operator*=(const _Tp& __t)
242 complex<_Tp>&
243 complex<_Tp>::operator/=(const _Tp& __t)
252 complex<_Tp>&
253 complex<_Tp>::operator=(const complex<_Up>& __z)
263 complex<_Tp>&
264 complex<_Tp>::operator+=(const complex<_Up>& __z)
274 complex<_Tp>&
275 complex<_Tp>::operator-=(const complex<_Up>& __z)
286 complex<_Tp>&
287 complex<_Tp>::operator*=(const complex<_Up>& __z)
299 complex<_Tp>&
300 complex<_Tp>::operator/=(const complex<_Up>& __z)
310 inline const complex<_Tp>&
311 complex<_Tp>::__rep() const { return *this; } in __rep()
317 inline complex<_Tp>
318 operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
320 complex<_Tp> __r = __x;
326 inline complex<_Tp>
327 operator+(const complex<_Tp>& __x, const _Tp& __y)
329 complex<_Tp> __r = __x;
335 inline complex<_Tp>
336 operator+(const _Tp& __x, const complex<_Tp>& __y)
338 complex<_Tp> __r = __y;
347 inline complex<_Tp>
348 operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
350 complex<_Tp> __r = __x;
356 inline complex<_Tp>
357 operator-(const complex<_Tp>& __x, const _Tp& __y)
359 complex<_Tp> __r = __x;
365 inline complex<_Tp>
366 operator-(const _Tp& __x, const complex<_Tp>& __y)
368 complex<_Tp> __r(__x, -__y.imag());
377 inline complex<_Tp>
378 operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
380 complex<_Tp> __r = __x;
386 inline complex<_Tp>
387 operator*(const complex<_Tp>& __x, const _Tp& __y)
389 complex<_Tp> __r = __x;
395 inline complex<_Tp>
396 operator*(const _Tp& __x, const complex<_Tp>& __y)
398 complex<_Tp> __r = __y;
407 inline complex<_Tp>
408 operator/(const complex<_Tp>& __x, const complex<_Tp>& __y)
410 complex<_Tp> __r = __x;
416 inline complex<_Tp>
417 operator/(const complex<_Tp>& __x, const _Tp& __y)
419 complex<_Tp> __r = __x;
425 inline complex<_Tp>
426 operator/(const _Tp& __x, const complex<_Tp>& __y)
428 complex<_Tp> __r = __x;
436 inline complex<_Tp>
437 operator+(const complex<_Tp>& __x)
442 inline complex<_Tp>
443 operator-(const complex<_Tp>& __x)
444 { return complex<_Tp>(-__x.real(), -__x.imag()); }
450 operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
455 operator==(const complex<_Tp>& __x, const _Tp& __y)
460 operator==(const _Tp& __x, const complex<_Tp>& __y)
468 operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y)
473 operator!=(const complex<_Tp>& __x, const _Tp& __y)
478 operator!=(const _Tp& __x, const complex<_Tp>& __y)
485 operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
497 __x = complex<_Tp>(__re_x, __im_x);
518 operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
531 real(complex<_Tp>& __z) in real()
536 real(const complex<_Tp>& __z) in real()
541 imag(complex<_Tp>& __z) in imag()
546 imag(const complex<_Tp>& __z) in imag()
552 __complex_abs(const complex<_Tp>& __z) in __complex_abs()
577 abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); } in abs()
581 abs(const complex<_Tp>& __z) { return __complex_abs(__z); } in abs()
588 __complex_arg(const complex<_Tp>& __z) in __complex_arg()
604 arg(const complex<_Tp>& __z) { return __complex_arg(__z.__rep()); } in arg()
608 arg(const complex<_Tp>& __z) { return __complex_arg(__z); } in arg()
620 static inline _Tp _S_do_it(const complex<_Tp>& __z) in _S_do_it()
632 static inline _Tp _S_do_it(const complex<_Tp>& __z)
641 norm(const complex<_Tp>& __z)
648 inline complex<_Tp>
650 { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); }
653 inline complex<_Tp>
654 conj(const complex<_Tp>& __z)
655 { return complex<_Tp>(__z.real(), -__z.imag()); }
661 inline complex<_Tp>
662 __complex_cos(const complex<_Tp>& __z)
666 return complex<_Tp>(cos(__x) * cosh(__y), -sin(__x) * sinh(__y));
681 inline complex<_Tp>
682 cos(const complex<_Tp>& __z) { return __complex_cos(__z.__rep()); }
685 inline complex<_Tp>
686 cos(const complex<_Tp>& __z) { return __complex_cos(__z); }
691 inline complex<_Tp>
692 __complex_cosh(const complex<_Tp>& __z)
696 return complex<_Tp>(cosh(__x) * cos(__y), sinh(__x) * sin(__y));
711 inline complex<_Tp>
712 cosh(const complex<_Tp>& __z) { return __complex_cosh(__z.__rep()); }
715 inline complex<_Tp>
716 cosh(const complex<_Tp>& __z) { return __complex_cosh(__z); }
721 inline complex<_Tp>
722 __complex_exp(const complex<_Tp>& __z)
737 inline complex<_Tp>
738 exp(const complex<_Tp>& __z) { return __complex_exp(__z.__rep()); }
741 inline complex<_Tp>
742 exp(const complex<_Tp>& __z) { return __complex_exp(__z); }
748 inline complex<_Tp>
749 __complex_log(const complex<_Tp>& __z)
750 { return complex<_Tp>(log(std::abs(__z)), std::arg(__z)); }
764 inline complex<_Tp>
765 log(const complex<_Tp>& __z) { return __complex_log(__z.__rep()); }
768 inline complex<_Tp>
769 log(const complex<_Tp>& __z) { return __complex_log(__z); }
773 inline complex<_Tp>
774 log10(const complex<_Tp>& __z)
779 inline complex<_Tp>
780 __complex_sin(const complex<_Tp>& __z)
784 return complex<_Tp>(sin(__x) * cosh(__y), cos(__x) * sinh(__y));
799 inline complex<_Tp>
800 sin(const complex<_Tp>& __z) { return __complex_sin(__z.__rep()); }
803 inline complex<_Tp>
804 sin(const complex<_Tp>& __z) { return __complex_sin(__z); }
809 inline complex<_Tp>
810 __complex_sinh(const complex<_Tp>& __z)
814 return complex<_Tp>(sinh(__x) * cos(__y), cosh(__x) * sin(__y));
829 inline complex<_Tp>
830 sinh(const complex<_Tp>& __z) { return __complex_sinh(__z.__rep()); }
833 inline complex<_Tp>
834 sinh(const complex<_Tp>& __z) { return __complex_sinh(__z); }
840 complex<_Tp>
841 __complex_sqrt(const complex<_Tp>& __z)
849 return complex<_Tp>(__t, __y < _Tp() ? -__t : __t);
856 ? complex<_Tp>(__u, __y / __t)
857 : complex<_Tp>(abs(__y) / __t, __y < _Tp() ? -__u : __u);
873 inline complex<_Tp>
874 sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z.__rep()); }
877 inline complex<_Tp>
878 sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z); }
884 inline complex<_Tp>
885 __complex_tan(const complex<_Tp>& __z)
900 inline complex<_Tp>
901 tan(const complex<_Tp>& __z) { return __complex_tan(__z.__rep()); }
904 inline complex<_Tp>
905 tan(const complex<_Tp>& __z) { return __complex_tan(__z); }
912 inline complex<_Tp>
913 __complex_tanh(const complex<_Tp>& __z)
928 inline complex<_Tp>
929 tanh(const complex<_Tp>& __z) { return __complex_tanh(__z.__rep()); }
932 inline complex<_Tp>
933 tanh(const complex<_Tp>& __z) { return __complex_tanh(__z); }
941 inline complex<_Tp>
942 pow(const complex<_Tp>& __z, int __n)
946 complex<_Tp>
947 pow(const complex<_Tp>& __x, const _Tp& __y)
956 complex<_Tp> __t = std::log(__x);
961 inline complex<_Tp>
962 __complex_pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
980 inline complex<_Tp>
981 pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
985 inline complex<_Tp>
986 pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
991 inline complex<_Tp>
992 pow(const _Tp& __x, const complex<_Tp>& __y)
996 : std::pow(complex<_Tp>(__x, _Tp()), __y);
1002 struct complex<float>
1007 complex(_ComplexT __z) : _M_value(__z) { }
1009 complex(float = 0.0f, float = 0.0f);
1011 explicit complex(const complex<double>&);
1012 explicit complex(const complex<long double>&);
1019 complex<float>& operator=(float);
1020 complex<float>& operator+=(float);
1021 complex<float>& operator-=(float);
1022 complex<float>& operator*=(float);
1023 complex<float>& operator/=(float);
1029 complex<float>&operator=(const complex<_Tp>&);
1031 complex<float>& operator+=(const complex<_Tp>&);
1033 complex<float>& operator-=(const complex<_Tp>&);
1035 complex<float>& operator*=(const complex<_Tp>&);
1037 complex<float>&operator/=(const complex<_Tp>&);
1046 complex<float>::real()
1050 complex<float>::real() const
1054 complex<float>::imag()
1058 complex<float>::imag() const
1062 complex<float>::complex(float r, float i)
1068 inline complex<float>&
1069 complex<float>::operator=(float __f)
1076 inline complex<float>&
1077 complex<float>::operator+=(float __f)
1083 inline complex<float>&
1084 complex<float>::operator-=(float __f)
1090 inline complex<float>&
1091 complex<float>::operator*=(float __f)
1097 inline complex<float>&
1098 complex<float>::operator/=(float __f)
1105 inline complex<float>&
1106 complex<float>::operator=(const complex<_Tp>& __z)
1114 inline complex<float>&
1115 complex<float>::operator+=(const complex<_Tp>& __z)
1123 inline complex<float>&
1124 complex<float>::operator-=(const complex<_Tp>& __z)
1132 inline complex<float>&
1133 complex<float>::operator*=(const complex<_Tp>& __z)
1143 inline complex<float>&
1144 complex<float>::operator/=(const complex<_Tp>& __z)
1156 struct complex<double>
1161 complex(_ComplexT __z) : _M_value(__z) { }
1163 complex(double = 0.0, double = 0.0);
1165 complex(const complex<float>&);
1166 explicit complex(const complex<long double>&);
1173 complex<double>& operator=(double);
1174 complex<double>& operator+=(double);
1175 complex<double>& operator-=(double);
1176 complex<double>& operator*=(double);
1177 complex<double>& operator/=(double);
1182 complex<double>& operator=(const complex<_Tp>&);
1184 complex<double>& operator+=(const complex<_Tp>&);
1186 complex<double>& operator-=(const complex<_Tp>&);
1188 complex<double>& operator*=(const complex<_Tp>&);
1190 complex<double>& operator/=(const complex<_Tp>&);
1199 complex<double>::real()
1203 complex<double>::real() const
1207 complex<double>::imag()
1211 complex<double>::imag() const
1215 complex<double>::complex(double __r, double __i)
1221 inline complex<double>&
1222 complex<double>::operator=(double __d)
1229 inline complex<double>&
1230 complex<double>::operator+=(double __d)
1236 inline complex<double>&
1237 complex<double>::operator-=(double __d)
1243 inline complex<double>&
1244 complex<double>::operator*=(double __d)
1250 inline complex<double>&
1251 complex<double>::operator/=(double __d)
1258 inline complex<double>&
1259 complex<double>::operator=(const complex<_Tp>& __z)
1267 inline complex<double>&
1268 complex<double>::operator+=(const complex<_Tp>& __z)
1276 inline complex<double>&
1277 complex<double>::operator-=(const complex<_Tp>& __z)
1285 inline complex<double>&
1286 complex<double>::operator*=(const complex<_Tp>& __z)
1296 inline complex<double>&
1297 complex<double>::operator/=(const complex<_Tp>& __z)
1309 struct complex<long double>
1314 complex(_ComplexT __z) : _M_value(__z) { }
1316 complex(long double = 0.0L, long double = 0.0L);
1318 complex(const complex<float>&);
1319 complex(const complex<double>&);
1326 complex<long double>& operator= (long double);
1327 complex<long double>& operator+= (long double);
1328 complex<long double>& operator-= (long double);
1329 complex<long double>& operator*= (long double);
1330 complex<long double>& operator/= (long double);
1335 complex<long double>& operator=(const complex<_Tp>&);
1337 complex<long double>& operator+=(const complex<_Tp>&);
1339 complex<long double>& operator-=(const complex<_Tp>&);
1341 complex<long double>& operator*=(const complex<_Tp>&);
1343 complex<long double>& operator/=(const complex<_Tp>&);
1352 complex<long double>::complex(long double __r, long double __i)
1359 complex<long double>::real()
1363 complex<long double>::real() const
1367 complex<long double>::imag()
1371 complex<long double>::imag() const
1374 inline complex<long double>&
1375 complex<long double>::operator=(long double __r)
1382 inline complex<long double>&
1383 complex<long double>::operator+=(long double __r)
1389 inline complex<long double>&
1390 complex<long double>::operator-=(long double __r)
1396 inline complex<long double>&
1397 complex<long double>::operator*=(long double __r)
1403 inline complex<long double>&
1404 complex<long double>::operator/=(long double __r)
1411 inline complex<long double>&
1412 complex<long double>::operator=(const complex<_Tp>& __z)
1420 inline complex<long double>&
1421 complex<long double>::operator+=(const complex<_Tp>& __z)
1429 inline complex<long double>&
1430 complex<long double>::operator-=(const complex<_Tp>& __z)
1438 inline complex<long double>&
1439 complex<long double>::operator*=(const complex<_Tp>& __z)
1449 inline complex<long double>&
1450 complex<long double>::operator/=(const complex<_Tp>& __z)
1464 complex<float>::complex(const complex<double>& __z)
1468 complex<float>::complex(const complex<long double>& __z)
1472 complex<double>::complex(const complex<float>& __z)
1476 complex<double>::complex(const complex<long double>& __z)
1480 complex<long double>::complex(const complex<float>& __z)
1484 complex<long double>::complex(const complex<double>& __z)