3 * Silicon Graphics Computer Systems, Inc.
8 * This material is provided "as is", with absolutely no warranty expressed
9 * or implied. Any use is at your own risk.
11 * Permission to use or copy this software for any purpose is hereby granted
12 * without fee, provided the above notices are retained on all copies.
13 * Permission to modify the code and to distribute modified code is granted,
14 * provided the above notices are retained, and a notice that the code was
15 * modified is included with the above copyright notice.
18 #ifndef _STLP_INTERNAL_COMPLEX
19 #define _STLP_INTERNAL_COMPLEX
21 // This header declares the template class complex, as described in
22 // in the draft C++ standard. Single-precision complex numbers
23 // are complex<float>, double-precision are complex<double>, and
24 // quad precision are complex<long double>.
26 // Note that the template class complex is declared within namespace
27 // std, as called for by the draft C++ standard.
29 #ifndef _STLP_INTERNAL_CMATH
30 # include <stl/_cmath.h>
37 typedef _Tp value_type
;
38 typedef complex<_Tp
> _Self
;
40 // Constructors, destructor, assignment operator.
41 complex() : _M_re(0), _M_im(0) {}
42 complex(const value_type
& __x
)
43 : _M_re(__x
), _M_im(0) {}
44 complex(const value_type
& __x
, const value_type
& __y
)
45 : _M_re(__x
), _M_im(__y
) {}
46 complex(const _Self
& __z
)
47 : _M_re(__z
._M_re
), _M_im(__z
._M_im
) {}
49 _Self
& operator=(const _Self
& __z
) {
55 #if defined (_STLP_MEMBER_TEMPLATES) && defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
57 explicit complex(const complex<_Tp2
>& __z
)
58 : _M_re(__z
._M_re
), _M_im(__z
._M_im
) {}
61 _Self
& operator=(const complex<_Tp2
>& __z
) {
66 #endif /* _STLP_MEMBER_TEMPLATES */
69 value_type
real() const { return _M_re
; }
70 value_type
imag() const { return _M_im
; }
72 // Arithmetic op= operations involving one real argument.
74 _Self
& operator= (const value_type
& __x
) {
79 _Self
& operator+= (const value_type
& __x
) {
83 _Self
& operator-= (const value_type
& __x
) {
87 _Self
& operator*= (const value_type
& __x
) {
92 _Self
& operator/= (const value_type
& __x
) {
98 // Arithmetic op= operations involving two complex arguments.
100 static void _STLP_CALL
_div(const value_type
& __z1_r
, const value_type
& __z1_i
,
101 const value_type
& __z2_r
, const value_type
& __z2_i
,
102 value_type
& __res_r
, value_type
& __res_i
);
104 static void _STLP_CALL
_div(const value_type
& __z1_r
,
105 const value_type
& __z2_r
, const value_type
& __z2_i
,
106 value_type
& __res_r
, value_type
& __res_i
);
108 #if defined (_STLP_MEMBER_TEMPLATES) // && defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
110 template <class _Tp2
> _Self
& operator+= (const complex<_Tp2
>& __z
) {
116 template <class _Tp2
> _Self
& operator-= (const complex<_Tp2
>& __z
) {
122 template <class _Tp2
> _Self
& operator*= (const complex<_Tp2
>& __z
) {
123 value_type __r
= _M_re
* __z
._M_re
- _M_im
* __z
._M_im
;
124 value_type __i
= _M_re
* __z
._M_im
+ _M_im
* __z
._M_re
;
130 template <class _Tp2
> _Self
& operator/= (const complex<_Tp2
>& __z
) {
133 _div(_M_re
, _M_im
, __z
._M_re
, __z
._M_im
, __r
, __i
);
138 #endif /* _STLP_MEMBER_TEMPLATES */
140 _Self
& operator+= (const _Self
& __z
) {
146 _Self
& operator-= (const _Self
& __z
) {
152 _Self
& operator*= (const _Self
& __z
) {
153 value_type __r
= _M_re
* __z
._M_re
- _M_im
* __z
._M_im
;
154 value_type __i
= _M_re
* __z
._M_im
+ _M_im
* __z
._M_re
;
160 _Self
& operator/= (const _Self
& __z
) {
163 _div(_M_re
, _M_im
, __z
._M_re
, __z
._M_im
, __r
, __i
);
174 // Explicit specializations for float, double, long double. The only
175 // reason for these specializations is to enable automatic conversions
176 // from complex<float> to complex<double>, and complex<double> to
177 // complex<long double>.
180 struct _STLP_CLASS_DECLSPEC
complex<float> {
181 typedef float value_type
;
182 typedef complex<float> _Self
;
183 // Constructors, destructor, assignment operator.
185 complex(value_type __x
= 0.0f
, value_type __y
= 0.0f
)
186 : _M_re(__x
), _M_im(__y
) {}
188 complex(const complex<float>& __z
) : _M_re(__z
._M_re
), _M_im(__z
._M_im
) {}
190 inline explicit complex(const complex<double>& __z
);
191 #ifndef _STLP_NO_LONG_DOUBLE
192 inline explicit complex(const complex<long double>& __z
);
195 value_type
real() const { return _M_re
; }
196 value_type
imag() const { return _M_im
; }
198 // Arithmetic op= operations involving one real argument.
200 _Self
& operator= (value_type __x
) {
205 _Self
& operator+= (value_type __x
) {
209 _Self
& operator-= (value_type __x
) {
213 _Self
& operator*= (value_type __x
) {
218 _Self
& operator/= (value_type __x
) {
224 // Arithmetic op= operations involving two complex arguments.
226 static void _STLP_CALL
_div(const float& __z1_r
, const float& __z1_i
,
227 const float& __z2_r
, const float& __z2_i
,
228 float& __res_r
, float& __res_i
);
230 static void _STLP_CALL
_div(const float& __z1_r
,
231 const float& __z2_r
, const float& __z2_i
,
232 float& __res_r
, float& __res_i
);
234 #if defined (_STLP_MEMBER_TEMPLATES)
235 template <class _Tp2
>
236 complex<float>& operator=(const complex<_Tp2
>& __z
) {
242 template <class _Tp2
>
243 complex<float>& operator+= (const complex<_Tp2
>& __z
) {
249 template <class _Tp2
>
250 complex<float>& operator-= (const complex<_Tp2
>& __z
) {
256 template <class _Tp2
>
257 complex<float>& operator*= (const complex<_Tp2
>& __z
) {
258 float __r
= _M_re
* __z
._M_re
- _M_im
* __z
._M_im
;
259 float __i
= _M_re
* __z
._M_im
+ _M_im
* __z
._M_re
;
265 template <class _Tp2
>
266 complex<float>& operator/= (const complex<_Tp2
>& __z
) {
269 _div(_M_re
, _M_im
, __z
._M_re
, __z
._M_im
, __r
, __i
);
275 #endif /* _STLP_MEMBER_TEMPLATES */
277 _Self
& operator=(const _Self
& __z
) {
283 _Self
& operator+= (const _Self
& __z
) {
289 _Self
& operator-= (const _Self
& __z
) {
295 _Self
& operator*= (const _Self
& __z
) {
296 value_type __r
= _M_re
* __z
._M_re
- _M_im
* __z
._M_im
;
297 value_type __i
= _M_re
* __z
._M_im
+ _M_im
* __z
._M_re
;
303 _Self
& operator/= (const _Self
& __z
) {
306 _div(_M_re
, _M_im
, __z
._M_re
, __z
._M_im
, __r
, __i
);
318 struct _STLP_CLASS_DECLSPEC
complex<double> {
319 typedef double value_type
;
320 typedef complex<double> _Self
;
322 // Constructors, destructor, assignment operator.
324 complex(value_type __x
= 0.0, value_type __y
= 0.0)
325 : _M_re(__x
), _M_im(__y
) {}
327 complex(const complex<double>& __z
)
328 : _M_re(__z
._M_re
), _M_im(__z
._M_im
) {}
329 inline complex(const complex<float>& __z
);
330 #if !defined (_STLP_NO_LONG_DOUBLE)
331 explicit inline complex(const complex<long double>& __z
);
334 value_type
real() const { return _M_re
; }
335 value_type
imag() const { return _M_im
; }
337 // Arithmetic op= operations involving one real argument.
339 _Self
& operator= (value_type __x
) {
344 _Self
& operator+= (value_type __x
) {
348 _Self
& operator-= (value_type __x
) {
352 _Self
& operator*= (value_type __x
) {
357 _Self
& operator/= (value_type __x
) {
363 // Arithmetic op= operations involving two complex arguments.
365 static void _STLP_CALL
_div(const double& __z1_r
, const double& __z1_i
,
366 const double& __z2_r
, const double& __z2_i
,
367 double& __res_r
, double& __res_i
);
368 static void _STLP_CALL
_div(const double& __z1_r
,
369 const double& __z2_r
, const double& __z2_i
,
370 double& __res_r
, double& __res_i
);
372 #if defined (_STLP_MEMBER_TEMPLATES) && defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
373 template <class _Tp2
>
374 complex<double>& operator=(const complex<_Tp2
>& __z
) {
380 template <class _Tp2
>
381 complex<double>& operator+= (const complex<_Tp2
>& __z
) {
387 template <class _Tp2
>
388 complex<double>& operator-= (const complex<_Tp2
>& __z
) {
394 template <class _Tp2
>
395 complex<double>& operator*= (const complex<_Tp2
>& __z
) {
396 double __r
= _M_re
* __z
._M_re
- _M_im
* __z
._M_im
;
397 double __i
= _M_re
* __z
._M_im
+ _M_im
* __z
._M_re
;
403 template <class _Tp2
>
404 complex<double>& operator/= (const complex<_Tp2
>& __z
) {
407 _div(_M_re
, _M_im
, __z
._M_re
, __z
._M_im
, __r
, __i
);
413 #endif /* _STLP_MEMBER_TEMPLATES */
415 _Self
& operator=(const _Self
& __z
) {
421 _Self
& operator+= (const _Self
& __z
) {
427 _Self
& operator-= (const _Self
& __z
) {
433 _Self
& operator*= (const _Self
& __z
) {
434 value_type __r
= _M_re
* __z
._M_re
- _M_im
* __z
._M_im
;
435 value_type __i
= _M_re
* __z
._M_im
+ _M_im
* __z
._M_re
;
441 _Self
& operator/= (const _Self
& __z
) {
444 _div(_M_re
, _M_im
, __z
._M_re
, __z
._M_im
, __r
, __i
);
455 #if !defined (_STLP_NO_LONG_DOUBLE)
458 struct _STLP_CLASS_DECLSPEC
complex<long double> {
459 typedef long double value_type
;
460 typedef complex<long double> _Self
;
462 // Constructors, destructor, assignment operator.
463 complex(value_type __x
= 0.0l, value_type __y
= 0.0l)
464 : _M_re(__x
), _M_im(__y
) {}
466 complex(const complex<long double>& __z
)
467 : _M_re(__z
._M_re
), _M_im(__z
._M_im
) {}
468 inline complex(const complex<float>& __z
);
469 inline complex(const complex<double>& __z
);
472 value_type
real() const { return _M_re
; }
473 value_type
imag() const { return _M_im
; }
475 // Arithmetic op= operations involving one real argument.
477 _Self
& operator= (value_type __x
) {
482 _Self
& operator+= (value_type __x
) {
486 _Self
& operator-= (value_type __x
) {
490 _Self
& operator*= (value_type __x
) {
495 _Self
& operator/= (value_type __x
) {
501 // Arithmetic op= operations involving two complex arguments.
503 static void _STLP_CALL
_div(const long double& __z1_r
, const long double& __z1_i
,
504 const long double& __z2_r
, const long double& __z2_i
,
505 long double& __res_r
, long double& __res_i
);
507 static void _STLP_CALL
_div(const long double& __z1_r
,
508 const long double& __z2_r
, const long double& __z2_i
,
509 long double& __res_r
, long double& __res_i
);
511 # if defined (_STLP_MEMBER_TEMPLATES) && defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
513 template <class _Tp2
>
514 complex<long double>& operator=(const complex<_Tp2
>& __z
) {
520 template <class _Tp2
>
521 complex<long double>& operator+= (const complex<_Tp2
>& __z
) {
527 template <class _Tp2
>
528 complex<long double>& operator-= (const complex<_Tp2
>& __z
) {
534 template <class _Tp2
>
535 complex<long double>& operator*= (const complex<_Tp2
>& __z
) {
536 long double __r
= _M_re
* __z
._M_re
- _M_im
* __z
._M_im
;
537 long double __i
= _M_re
* __z
._M_im
+ _M_im
* __z
._M_re
;
543 template <class _Tp2
>
544 complex<long double>& operator/= (const complex<_Tp2
>& __z
) {
547 _div(_M_re
, _M_im
, __z
._M_re
, __z
._M_im
, __r
, __i
);
553 # endif /* _STLP_MEMBER_TEMPLATES */
555 _Self
& operator=(const _Self
& __z
) {
561 _Self
& operator+= (const _Self
& __z
) {
567 _Self
& operator-= (const _Self
& __z
) {
573 _Self
& operator*= (const _Self
& __z
) {
574 value_type __r
= _M_re
* __z
._M_re
- _M_im
* __z
._M_im
;
575 value_type __i
= _M_re
* __z
._M_im
+ _M_im
* __z
._M_re
;
581 _Self
& operator/= (const _Self
& __z
) {
584 _div(_M_re
, _M_im
, __z
._M_re
, __z
._M_im
, __r
, __i
);
595 #endif /* _STLP_NO_LONG_DOUBLE */
597 // Converting constructors from one of these three specialized types
600 inline complex<float>::complex(const complex<double>& __z
)
601 : _M_re((float)__z
._M_re
), _M_im((float)__z
._M_im
) {}
602 inline complex<double>::complex(const complex<float>& __z
)
603 : _M_re(__z
._M_re
), _M_im(__z
._M_im
) {}
604 #ifndef _STLP_NO_LONG_DOUBLE
605 inline complex<float>::complex(const complex<long double>& __z
)
606 : _M_re((float)__z
._M_re
), _M_im((float)__z
._M_im
) {}
607 inline complex<double>::complex(const complex<long double>& __z
)
608 : _M_re((double)__z
._M_re
), _M_im((double)__z
._M_im
) {}
609 inline complex<long double>::complex(const complex<float>& __z
)
610 : _M_re(__z
._M_re
), _M_im(__z
._M_im
) {}
611 inline complex<long double>::complex(const complex<double>& __z
)
612 : _M_re(__z
._M_re
), _M_im(__z
._M_im
) {}
615 // Unary non-member arithmetic operators.
618 inline complex<_Tp
> _STLP_CALL
operator+(const complex<_Tp
>& __z
)
622 inline complex<_Tp
> _STLP_CALL
operator-(const complex<_Tp
>& __z
)
623 { return complex<_Tp
>(-__z
._M_re
, -__z
._M_im
); }
625 // Non-member arithmetic operations involving one real argument.
628 inline complex<_Tp
> _STLP_CALL
operator+(const _Tp
& __x
, const complex<_Tp
>& __z
)
629 { return complex<_Tp
>(__x
+ __z
._M_re
, __z
._M_im
); }
632 inline complex<_Tp
> _STLP_CALL
operator+(const complex<_Tp
>& __z
, const _Tp
& __x
)
633 { return complex<_Tp
>(__z
._M_re
+ __x
, __z
._M_im
); }
636 inline complex<_Tp
> _STLP_CALL
operator-(const _Tp
& __x
, const complex<_Tp
>& __z
)
637 { return complex<_Tp
>(__x
- __z
._M_re
, -__z
._M_im
); }
640 inline complex<_Tp
> _STLP_CALL
operator-(const complex<_Tp
>& __z
, const _Tp
& __x
)
641 { return complex<_Tp
>(__z
._M_re
- __x
, __z
._M_im
); }
644 inline complex<_Tp
> _STLP_CALL
operator*(const _Tp
& __x
, const complex<_Tp
>& __z
)
645 { return complex<_Tp
>(__x
* __z
._M_re
, __x
* __z
._M_im
); }
648 inline complex<_Tp
> _STLP_CALL
operator*(const complex<_Tp
>& __z
, const _Tp
& __x
)
649 { return complex<_Tp
>(__z
._M_re
* __x
, __z
._M_im
* __x
); }
652 inline complex<_Tp
> _STLP_CALL
operator/(const _Tp
& __x
, const complex<_Tp
>& __z
) {
653 complex<_Tp
> __result
;
654 complex<_Tp
>::_div(__x
,
655 __z
._M_re
, __z
._M_im
,
656 __result
._M_re
, __result
._M_im
);
661 inline complex<_Tp
> _STLP_CALL
operator/(const complex<_Tp
>& __z
, const _Tp
& __x
)
662 { return complex<_Tp
>(__z
._M_re
/ __x
, __z
._M_im
/ __x
); }
664 // Non-member arithmetic operations involving two complex arguments
667 inline complex<_Tp
> _STLP_CALL
668 operator+(const complex<_Tp
>& __z1
, const complex<_Tp
>& __z2
)
669 { return complex<_Tp
>(__z1
._M_re
+ __z2
._M_re
, __z1
._M_im
+ __z2
._M_im
); }
672 inline complex<_Tp
> _STLP_CALL
673 operator-(const complex<_Tp
>& __z1
, const complex<_Tp
>& __z2
)
674 { return complex<_Tp
>(__z1
._M_re
- __z2
._M_re
, __z1
._M_im
- __z2
._M_im
); }
677 inline complex<_Tp
> _STLP_CALL
678 operator*(const complex<_Tp
>& __z1
, const complex<_Tp
>& __z2
) {
679 return complex<_Tp
>(__z1
._M_re
* __z2
._M_re
- __z1
._M_im
* __z2
._M_im
,
680 __z1
._M_re
* __z2
._M_im
+ __z1
._M_im
* __z2
._M_re
);
684 inline complex<_Tp
> _STLP_CALL
685 operator/(const complex<_Tp
>& __z1
, const complex<_Tp
>& __z2
) {
686 complex<_Tp
> __result
;
687 complex<_Tp
>::_div(__z1
._M_re
, __z1
._M_im
,
688 __z2
._M_re
, __z2
._M_im
,
689 __result
._M_re
, __result
._M_im
);
693 // Comparison operators.
696 inline bool _STLP_CALL
operator==(const complex<_Tp
>& __z1
, const complex<_Tp
>& __z2
)
697 { return __z1
._M_re
== __z2
._M_re
&& __z1
._M_im
== __z2
._M_im
; }
700 inline bool _STLP_CALL
operator==(const complex<_Tp
>& __z
, const _Tp
& __x
)
701 { return __z
._M_re
== __x
&& __z
._M_im
== 0; }
704 inline bool _STLP_CALL
operator==(const _Tp
& __x
, const complex<_Tp
>& __z
)
705 { return __x
== __z
._M_re
&& 0 == __z
._M_im
; }
707 //04/27/04 dums: removal of this check, if it is restablish
708 //please explain why the other operators are not macro guarded
709 //#ifdef _STLP_FUNCTION_TMPL_PARTIAL_ORDER
712 inline bool _STLP_CALL
operator!=(const complex<_Tp
>& __z1
, const complex<_Tp
>& __z2
)
713 { return __z1
._M_re
!= __z2
._M_re
|| __z1
._M_im
!= __z2
._M_im
; }
715 //#endif /* _STLP_FUNCTION_TMPL_PARTIAL_ORDER */
718 inline bool _STLP_CALL
operator!=(const complex<_Tp
>& __z
, const _Tp
& __x
)
719 { return __z
._M_re
!= __x
|| __z
._M_im
!= 0; }
722 inline bool _STLP_CALL
operator!=(const _Tp
& __x
, const complex<_Tp
>& __z
)
723 { return __x
!= __z
._M_re
|| 0 != __z
._M_im
; }
725 // Other basic arithmetic operations
727 inline _Tp _STLP_CALL
real(const complex<_Tp
>& __z
)
728 { return __z
._M_re
; }
731 inline _Tp _STLP_CALL
imag(const complex<_Tp
>& __z
)
732 { return __z
._M_im
; }
735 _Tp _STLP_CALL
abs(const complex<_Tp
>& __z
);
738 _Tp _STLP_CALL
arg(const complex<_Tp
>& __z
);
741 inline _Tp _STLP_CALL
norm(const complex<_Tp
>& __z
)
742 { return __z
._M_re
* __z
._M_re
+ __z
._M_im
* __z
._M_im
; }
745 inline complex<_Tp
> _STLP_CALL
conj(const complex<_Tp
>& __z
)
746 { return complex<_Tp
>(__z
._M_re
, -__z
._M_im
); }
749 complex<_Tp
> _STLP_CALL
polar(const _Tp
& __rho
)
750 { return complex<_Tp
>(__rho
, 0); }
753 complex<_Tp
> _STLP_CALL
polar(const _Tp
& __rho
, const _Tp
& __phi
);
756 _STLP_DECLSPEC
float _STLP_CALL
abs(const complex<float>&);
758 _STLP_DECLSPEC
double _STLP_CALL
abs(const complex<double>&);
760 _STLP_DECLSPEC
float _STLP_CALL
arg(const complex<float>&);
762 _STLP_DECLSPEC
double _STLP_CALL
arg(const complex<double>&);
764 _STLP_DECLSPEC
complex<float> _STLP_CALL
polar(const float& __rho
, const float& __phi
);
766 _STLP_DECLSPEC
complex<double> _STLP_CALL
polar(const double& __rho
, const double& __phi
);
769 _Tp _STLP_CALL
abs(const complex<_Tp
>& __z
)
770 { return _Tp(abs(complex<double>(double(__z
.real()), double(__z
.imag())))); }
773 _Tp _STLP_CALL
arg(const complex<_Tp
>& __z
)
774 { return _Tp(arg(complex<double>(double(__z
.real()), double(__z
.imag())))); }
777 complex<_Tp
> _STLP_CALL
polar(const _Tp
& __rho
, const _Tp
& __phi
) {
778 complex<double> __tmp
= polar(double(__rho
), double(__phi
));
779 return complex<_Tp
>(_Tp(__tmp
.real()), _Tp(__tmp
.imag()));
782 #if !defined (_STLP_NO_LONG_DOUBLE)
784 _STLP_DECLSPEC
long double _STLP_CALL
arg(const complex<long double>&);
786 _STLP_DECLSPEC
long double _STLP_CALL
abs(const complex<long double>&);
788 _STLP_DECLSPEC
complex<long double> _STLP_CALL
polar(const long double&, const long double&);
792 #if !defined (_STLP_USE_NO_IOSTREAMS)
796 # ifndef _STLP_INTERNAL_IOSFWD
797 # include <stl/_iosfwd.h>
800 _STLP_BEGIN_NAMESPACE
802 // Complex output, in the form (re,im). We use a two-step process
803 // involving stringstream so that we get the padding right.
804 template <class _Tp
, class _CharT
, class _Traits
>
805 basic_ostream
<_CharT
, _Traits
>& _STLP_CALL
806 operator<<(basic_ostream
<_CharT
, _Traits
>& __os
, const complex<_Tp
>& __z
);
808 template <class _Tp
, class _CharT
, class _Traits
>
809 basic_istream
<_CharT
, _Traits
>& _STLP_CALL
810 operator>>(basic_istream
<_CharT
, _Traits
>& __is
, complex<_Tp
>& __z
);
812 // Specializations for narrow characters; lets us avoid widen.
814 _STLP_OPERATOR_TEMPLATE
815 _STLP_DECLSPEC basic_istream
<char, char_traits
<char> >& _STLP_CALL
816 operator>>(basic_istream
<char, char_traits
<char> >& __is
, complex<float>& __z
);
818 _STLP_OPERATOR_TEMPLATE
819 _STLP_DECLSPEC basic_istream
<char, char_traits
<char> >& _STLP_CALL
820 operator>>(basic_istream
<char, char_traits
<char> >& __is
, complex<double>& __z
);
822 _STLP_OPERATOR_TEMPLATE
823 _STLP_DECLSPEC basic_ostream
<char, char_traits
<char> >& _STLP_CALL
824 operator<<(basic_ostream
<char, char_traits
<char> >& __is
, const complex<float>& __z
);
826 _STLP_OPERATOR_TEMPLATE
827 _STLP_DECLSPEC basic_ostream
<char, char_traits
<char> >& _STLP_CALL
828 operator<<(basic_ostream
<char, char_traits
<char> >& __is
, const complex<double>& __z
);
830 # if !defined (_STLP_NO_LONG_DOUBLE)
831 _STLP_OPERATOR_TEMPLATE
832 _STLP_DECLSPEC basic_istream
<char, char_traits
<char> >& _STLP_CALL
833 operator>>(basic_istream
<char, char_traits
<char> >& __is
, complex<long double>& __z
);
835 _STLP_OPERATOR_TEMPLATE
836 _STLP_DECLSPEC basic_ostream
<char, char_traits
<char> >& _STLP_CALL
837 operator<<(basic_ostream
<char, char_traits
<char> >& __is
, const complex<long double>& __z
);
841 # if defined (_STLP_USE_TEMPLATE_EXPORT) && ! defined (_STLP_NO_WCHAR_T)
843 _STLP_EXPORT_TEMPLATE basic_istream
<wchar_t, char_traits
<wchar_t> >& _STLP_CALL
844 operator>>(basic_istream
<wchar_t, char_traits
<wchar_t> >&, complex<double>&);
845 _STLP_EXPORT_TEMPLATE basic_ostream
<wchar_t, char_traits
<wchar_t> >& _STLP_CALL
846 operator<<(basic_ostream
<wchar_t, char_traits
<wchar_t> >&, const complex<double>&);
847 _STLP_EXPORT_TEMPLATE basic_istream
<wchar_t, char_traits
<wchar_t> >& _STLP_CALL
848 operator>>(basic_istream
<wchar_t, char_traits
<wchar_t> >&, complex<float>&);
849 _STLP_EXPORT_TEMPLATE basic_ostream
<wchar_t, char_traits
<wchar_t> >& _STLP_CALL
850 operator<<(basic_ostream
<wchar_t, char_traits
<wchar_t> >&, const complex<float>&);
852 # if !defined (_STLP_NO_LONG_DOUBLE)
853 _STLP_EXPORT_TEMPLATE basic_istream
<wchar_t, char_traits
<wchar_t> >& _STLP_CALL
854 operator>>(basic_istream
<wchar_t, char_traits
<wchar_t> >&, complex<long double>&);
855 _STLP_EXPORT_TEMPLATE basic_ostream
<wchar_t, char_traits
<wchar_t> >& _STLP_CALL
856 operator<<(basic_ostream
<wchar_t, char_traits
<wchar_t> >&, const complex<long double>&);
862 // Transcendental functions. These are defined only for float,
863 // double, and long double. (Sqrt isn't transcendental, of course,
864 // but it's included in this section anyway.)
866 _STLP_DECLSPEC
complex<float> _STLP_CALL
sqrt(const complex<float>&);
868 _STLP_DECLSPEC
complex<float> _STLP_CALL
exp(const complex<float>&);
869 _STLP_DECLSPEC
complex<float> _STLP_CALL
log(const complex<float>&);
870 _STLP_DECLSPEC
complex<float> _STLP_CALL
log10(const complex<float>&);
872 _STLP_DECLSPEC
complex<float> _STLP_CALL
pow(const complex<float>&, int);
873 _STLP_DECLSPEC
complex<float> _STLP_CALL
pow(const complex<float>&, const float&);
874 _STLP_DECLSPEC
complex<float> _STLP_CALL
pow(const float&, const complex<float>&);
875 _STLP_DECLSPEC
complex<float> _STLP_CALL
pow(const complex<float>&, const complex<float>&);
877 _STLP_DECLSPEC
complex<float> _STLP_CALL
sin(const complex<float>&);
878 _STLP_DECLSPEC
complex<float> _STLP_CALL
cos(const complex<float>&);
879 _STLP_DECLSPEC
complex<float> _STLP_CALL
tan(const complex<float>&);
881 _STLP_DECLSPEC
complex<float> _STLP_CALL
sinh(const complex<float>&);
882 _STLP_DECLSPEC
complex<float> _STLP_CALL
cosh(const complex<float>&);
883 _STLP_DECLSPEC
complex<float> _STLP_CALL
tanh(const complex<float>&);
885 _STLP_DECLSPEC
complex<double> _STLP_CALL
sqrt(const complex<double>&);
887 _STLP_DECLSPEC
complex<double> _STLP_CALL
exp(const complex<double>&);
888 _STLP_DECLSPEC
complex<double> _STLP_CALL
log(const complex<double>&);
889 _STLP_DECLSPEC
complex<double> _STLP_CALL
log10(const complex<double>&);
891 _STLP_DECLSPEC
complex<double> _STLP_CALL
pow(const complex<double>&, int);
892 _STLP_DECLSPEC
complex<double> _STLP_CALL
pow(const complex<double>&, const double&);
893 _STLP_DECLSPEC
complex<double> _STLP_CALL
pow(const double&, const complex<double>&);
894 _STLP_DECLSPEC
complex<double> _STLP_CALL
pow(const complex<double>&, const complex<double>&);
896 _STLP_DECLSPEC
complex<double> _STLP_CALL
sin(const complex<double>&);
897 _STLP_DECLSPEC
complex<double> _STLP_CALL
cos(const complex<double>&);
898 _STLP_DECLSPEC
complex<double> _STLP_CALL
tan(const complex<double>&);
900 _STLP_DECLSPEC
complex<double> _STLP_CALL
sinh(const complex<double>&);
901 _STLP_DECLSPEC
complex<double> _STLP_CALL
cosh(const complex<double>&);
902 _STLP_DECLSPEC
complex<double> _STLP_CALL
tanh(const complex<double>&);
904 #if !defined (_STLP_NO_LONG_DOUBLE)
905 _STLP_DECLSPEC
complex<long double> _STLP_CALL
sqrt(const complex<long double>&);
906 _STLP_DECLSPEC
complex<long double> _STLP_CALL
exp(const complex<long double>&);
907 _STLP_DECLSPEC
complex<long double> _STLP_CALL
log(const complex<long double>&);
908 _STLP_DECLSPEC
complex<long double> _STLP_CALL
log10(const complex<long double>&);
910 _STLP_DECLSPEC
complex<long double> _STLP_CALL
pow(const complex<long double>&, int);
911 _STLP_DECLSPEC
complex<long double> _STLP_CALL
pow(const complex<long double>&, const long double&);
912 _STLP_DECLSPEC
complex<long double> _STLP_CALL
pow(const long double&, const complex<long double>&);
913 _STLP_DECLSPEC
complex<long double> _STLP_CALL
pow(const complex<long double>&,
914 const complex<long double>&);
916 _STLP_DECLSPEC
complex<long double> _STLP_CALL
sin(const complex<long double>&);
917 _STLP_DECLSPEC
complex<long double> _STLP_CALL
cos(const complex<long double>&);
918 _STLP_DECLSPEC
complex<long double> _STLP_CALL
tan(const complex<long double>&);
920 _STLP_DECLSPEC
complex<long double> _STLP_CALL
sinh(const complex<long double>&);
921 _STLP_DECLSPEC
complex<long double> _STLP_CALL
cosh(const complex<long double>&);
922 _STLP_DECLSPEC
complex<long double> _STLP_CALL
tanh(const complex<long double>&);
927 #ifndef _STLP_LINK_TIME_INSTANTIATION
928 # include <stl/_complex.c>