ReactOS 0.4.16-dev-306-g647d351
_complex.h File Reference
#include <stl/_cmath.h>
#include <stl/_iosfwd.h>
#include <stl/_complex.c>
Include dependency graph for _complex.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  complex< _Tp >
 
struct  complex< float >
 
struct  complex< double >
 
struct  complex< long double >
 

Functions

template<class _Tp >
complex< _Tp > _STLP_CALL operator+ (const complex< _Tp > &__z)
 
template<class _Tp >
complex< _Tp > _STLP_CALL operator- (const complex< _Tp > &__z)
 
template<class _Tp >
complex< _Tp > _STLP_CALL operator+ (const _Tp &__x, const complex< _Tp > &__z)
 
template<class _Tp >
complex< _Tp > _STLP_CALL operator+ (const complex< _Tp > &__z, const _Tp &__x)
 
template<class _Tp >
complex< _Tp > _STLP_CALL operator- (const _Tp &__x, const complex< _Tp > &__z)
 
template<class _Tp >
complex< _Tp > _STLP_CALL operator- (const complex< _Tp > &__z, const _Tp &__x)
 
template<class _Tp >
complex< _Tp > _STLP_CALL operator* (const _Tp &__x, const complex< _Tp > &__z)
 
template<class _Tp >
complex< _Tp > _STLP_CALL operator* (const complex< _Tp > &__z, const _Tp &__x)
 
template<class _Tp >
complex< _Tp > _STLP_CALL operator/ (const _Tp &__x, const complex< _Tp > &__z)
 
template<class _Tp >
complex< _Tp > _STLP_CALL operator/ (const complex< _Tp > &__z, const _Tp &__x)
 
template<class _Tp >
complex< _Tp > _STLP_CALL operator+ (const complex< _Tp > &__z1, const complex< _Tp > &__z2)
 
template<class _Tp >
complex< _Tp > _STLP_CALL operator- (const complex< _Tp > &__z1, const complex< _Tp > &__z2)
 
template<class _Tp >
complex< _Tp > _STLP_CALL operator* (const complex< _Tp > &__z1, const complex< _Tp > &__z2)
 
template<class _Tp >
complex< _Tp > _STLP_CALL operator/ (const complex< _Tp > &__z1, const complex< _Tp > &__z2)
 
template<class _Tp >
bool _STLP_CALL operator== (const complex< _Tp > &__z1, const complex< _Tp > &__z2)
 
template<class _Tp >
bool _STLP_CALL operator== (const complex< _Tp > &__z, const _Tp &__x)
 
template<class _Tp >
bool _STLP_CALL operator== (const _Tp &__x, const complex< _Tp > &__z)
 
template<class _Tp >
bool _STLP_CALL operator!= (const complex< _Tp > &__z1, const complex< _Tp > &__z2)
 
template<class _Tp >
bool _STLP_CALL operator!= (const complex< _Tp > &__z, const _Tp &__x)
 
template<class _Tp >
bool _STLP_CALL operator!= (const _Tp &__x, const complex< _Tp > &__z)
 
template<class _Tp >
_Tp _STLP_CALL real (const complex< _Tp > &__z)
 
template<class _Tp >
_Tp _STLP_CALL imag (const complex< _Tp > &__z)
 
template<class _Tp >
_Tp _STLP_CALL abs (const complex< _Tp > &__z)
 
template<class _Tp >
_Tp _STLP_CALL arg (const complex< _Tp > &__z)
 
template<class _Tp >
_Tp _STLP_CALL norm (const complex< _Tp > &__z)
 
template<class _Tp >
complex< _Tp > _STLP_CALL conj (const complex< _Tp > &__z)
 
template<class _Tp >
complex< _Tp > _STLP_CALL polar (const _Tp &__rho)
 
template<class _Tp >
complex< _Tp > _STLP_CALL polar (const _Tp &__rho, const _Tp &__phi)
 
_STLP_TEMPLATE_NULL _STLP_DECLSPEC float _STLP_CALL abs (const complex< float > &)
 
_STLP_TEMPLATE_NULL _STLP_DECLSPEC double _STLP_CALL abs (const complex< double > &)
 
_STLP_TEMPLATE_NULL _STLP_DECLSPEC float _STLP_CALL arg (const complex< float > &)
 
_STLP_TEMPLATE_NULL _STLP_DECLSPEC double _STLP_CALL arg (const complex< double > &)
 
_STLP_TEMPLATE_NULL _STLP_DECLSPEC complex< float > _STLP_CALL polar (const float &__rho, const float &__phi)
 
_STLP_TEMPLATE_NULL _STLP_DECLSPEC complex< double > _STLP_CALL polar (const double &__rho, const double &__phi)
 
_STLP_TEMPLATE_NULL _STLP_DECLSPEC long double _STLP_CALL arg (const complex< long double > &)
 
_STLP_TEMPLATE_NULL _STLP_DECLSPEC long double _STLP_CALL abs (const complex< long double > &)
 
_STLP_TEMPLATE_NULL _STLP_DECLSPEC complex< long double > _STLP_CALL polar (const long double &, const long double &)
 
template<class _Tp , class _CharT , class _Traits >
_STLP_END_NAMESPACE _STLP_BEGIN_NAMESPACE basic_ostream< _CharT, _Traits > &_STLP_CALL operator<< (basic_ostream< _CharT, _Traits > &__os, const complex< _Tp > &__z)
 
template<class _Tp , class _CharT , class _Traits >
basic_istream< _CharT, _Traits > &_STLP_CALL operator>> (basic_istream< _CharT, _Traits > &__is, complex< _Tp > &__z)
 
_STLP_OPERATOR_TEMPLATE _STLP_DECLSPEC basic_istream< char, char_traits< char > > &_STLP_CALL operator>> (basic_istream< char, char_traits< char > > &__is, complex< float > &__z)
 
_STLP_OPERATOR_TEMPLATE _STLP_DECLSPEC basic_istream< char, char_traits< char > > &_STLP_CALL operator>> (basic_istream< char, char_traits< char > > &__is, complex< double > &__z)
 
_STLP_OPERATOR_TEMPLATE _STLP_DECLSPEC basic_ostream< char, char_traits< char > > &_STLP_CALL operator<< (basic_ostream< char, char_traits< char > > &__is, const complex< float > &__z)
 
_STLP_OPERATOR_TEMPLATE _STLP_DECLSPEC basic_ostream< char, char_traits< char > > &_STLP_CALL operator<< (basic_ostream< char, char_traits< char > > &__is, const complex< double > &__z)
 
_STLP_OPERATOR_TEMPLATE _STLP_DECLSPEC basic_istream< char, char_traits< char > > &_STLP_CALL operator>> (basic_istream< char, char_traits< char > > &__is, complex< long double > &__z)
 
_STLP_OPERATOR_TEMPLATE _STLP_DECLSPEC basic_ostream< char, char_traits< char > > &_STLP_CALL operator<< (basic_ostream< char, char_traits< char > > &__is, const complex< long double > &__z)
 
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt (const complex< float > &)
 
_STLP_DECLSPEC complex< float > _STLP_CALL exp (const complex< float > &)
 
_STLP_DECLSPEC complex< float > _STLP_CALL log (const complex< float > &)
 
_STLP_DECLSPEC complex< float > _STLP_CALL log10 (const complex< float > &)
 
_STLP_DECLSPEC complex< float > _STLP_CALL pow (const complex< float > &, int)
 
_STLP_DECLSPEC complex< float > _STLP_CALL pow (const complex< float > &, const float &)
 
_STLP_DECLSPEC complex< float > _STLP_CALL pow (const float &, const complex< float > &)
 
_STLP_DECLSPEC complex< float > _STLP_CALL pow (const complex< float > &, const complex< float > &)
 
_STLP_DECLSPEC complex< float > _STLP_CALL sin (const complex< float > &)
 
_STLP_DECLSPEC complex< float > _STLP_CALL cos (const complex< float > &)
 
_STLP_DECLSPEC complex< float > _STLP_CALL tan (const complex< float > &)
 
_STLP_DECLSPEC complex< float > _STLP_CALL sinh (const complex< float > &)
 
_STLP_DECLSPEC complex< float > _STLP_CALL cosh (const complex< float > &)
 
_STLP_DECLSPEC complex< float > _STLP_CALL tanh (const complex< float > &)
 
_STLP_DECLSPEC complex< double > _STLP_CALL sqrt (const complex< double > &)
 
_STLP_DECLSPEC complex< double > _STLP_CALL exp (const complex< double > &)
 
_STLP_DECLSPEC complex< double > _STLP_CALL log (const complex< double > &)
 
_STLP_DECLSPEC complex< double > _STLP_CALL log10 (const complex< double > &)
 
_STLP_DECLSPEC complex< double > _STLP_CALL pow (const complex< double > &, int)
 
_STLP_DECLSPEC complex< double > _STLP_CALL pow (const complex< double > &, const double &)
 
_STLP_DECLSPEC complex< double > _STLP_CALL pow (const double &, const complex< double > &)
 
_STLP_DECLSPEC complex< double > _STLP_CALL pow (const complex< double > &, const complex< double > &)
 
_STLP_DECLSPEC complex< double > _STLP_CALL sin (const complex< double > &)
 
_STLP_DECLSPEC complex< double > _STLP_CALL cos (const complex< double > &)
 
_STLP_DECLSPEC complex< double > _STLP_CALL tan (const complex< double > &)
 
_STLP_DECLSPEC complex< double > _STLP_CALL sinh (const complex< double > &)
 
_STLP_DECLSPEC complex< double > _STLP_CALL cosh (const complex< double > &)
 
_STLP_DECLSPEC complex< double > _STLP_CALL tanh (const complex< double > &)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL sqrt (const complex< long double > &)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL exp (const complex< long double > &)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL log (const complex< long double > &)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL log10 (const complex< long double > &)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL pow (const complex< long double > &, int)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL pow (const complex< long double > &, const long double &)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL pow (const long double &, const complex< long double > &)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL pow (const complex< long double > &, const complex< long double > &)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL sin (const complex< long double > &)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL cos (const complex< long double > &)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL tan (const complex< long double > &)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL sinh (const complex< long double > &)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL cosh (const complex< long double > &)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL tanh (const complex< long double > &)
 

Function Documentation

◆ abs() [1/4]

template<class _Tp >
_Tp _STLP_CALL abs ( const complex< _Tp > &  __z)

Definition at line 769 of file _complex.h.

770{ return _Tp(abs(complex<double>(double(__z.real()), double(__z.imag())))); }
#define abs(i)
Definition: fconv.c:206
value_type real() const
Definition: _complex.h:69
value_type imag() const
Definition: _complex.h:70

◆ abs() [2/4]

Definition at line 43 of file complex.cpp.

44{ return ::hypot(__z._M_re, __z._M_im); }
value_type _M_im
Definition: _complex.h:452
value_type _M_re
Definition: _complex.h:451

◆ abs() [3/4]

Definition at line 40 of file complex.cpp.

41{ return ::hypot(__z._M_re, __z._M_im); }
value_type _M_im
Definition: _complex.h:314
value_type _M_re
Definition: _complex.h:313

◆ abs() [4/4]

Definition at line 48 of file complex.cpp.

49{ return ::hypot(__z._M_re, __z._M_im); }

◆ arg() [1/4]

template<class _Tp >
_Tp _STLP_CALL arg ( const complex< _Tp > &  __z)

Definition at line 773 of file _complex.h.

774{ return _Tp(arg(complex<double>(double(__z.real()), double(__z.imag())))); }
void * arg
Definition: msvc.h:10

◆ arg() [2/4]

Definition at line 59 of file complex.cpp.

60{ return ::atan2(__z._M_im, __z._M_re); }

◆ arg() [3/4]

Definition at line 55 of file complex.cpp.

56{ return ::atan2(__z._M_im, __z._M_re); }

◆ arg() [4/4]

Definition at line 64 of file complex.cpp.

65{ return ::atan2(__z._M_im, __z._M_re); }

◆ conj()

template<class _Tp >
complex< _Tp > _STLP_CALL conj ( const complex< _Tp > &  __z)
inline

Definition at line 745 of file _complex.h.

746{ return complex<_Tp>(__z._M_re, -__z._M_im); }
value_type _M_im
Definition: _complex.h:171
value_type _M_re
Definition: _complex.h:170

◆ cos() [1/3]

Definition at line 95 of file complex_trig.cpp.

96{ return cosT(z); }
static complex< _Tp > cosT(const complex< _Tp > &z)
GLdouble GLdouble z
Definition: glext.h:5874

◆ cos() [2/3]

◆ cos() [3/3]

Definition at line 99 of file complex_trig.cpp.

100{ return cosT(z); }

◆ cosh() [1/3]

Definition at line 159 of file complex_trig.cpp.

160{ return coshT(z); }
static complex< _Tp > coshT(const complex< _Tp > &z)

◆ cosh() [2/3]

◆ cosh() [3/3]

Definition at line 163 of file complex_trig.cpp.

164{ return coshT(z); }

◆ exp() [1/3]

Definition at line 210 of file complex.cpp.

211{ return expT(z); }
static complex< _Tp > expT(const complex< _Tp > &z)
Definition: complex.cpp:202

◆ exp() [2/3]

Definition at line 207 of file complex.cpp.

208{ return expT(z); }

◆ exp() [3/3]

Definition at line 214 of file complex.cpp.

215{ return expT(z); }

◆ imag()

template<class _Tp >
_Tp _STLP_CALL imag ( const complex< _Tp > &  __z)
inline

Definition at line 731 of file _complex.h.

732{ return __z._M_im; }

◆ log() [1/3]

Definition at line 256 of file complex.cpp.

257{ return logT(z); }
static complex< _Tp > logT(const complex< _Tp > &z)
Definition: complex.cpp:246

◆ log() [2/3]

Definition at line 253 of file complex.cpp.

254{ return logT(z); }

◆ log() [3/3]

Definition at line 260 of file complex.cpp.

261{ return logT(z); }

◆ log10() [1/3]

Definition at line 234 of file complex.cpp.

235{ return log10T(z, LN10_INV); }
static const double LN10_INV
Definition: complex.cpp:233
static complex< _Tp > log10T(const complex< _Tp > &z, const _Tp &ln10_inv)
Definition: complex.cpp:221

◆ log10() [2/3]

Definition at line 230 of file complex.cpp.

231{ return log10T(z, LN10_INVF); }
static const float LN10_INVF
Definition: complex.cpp:229

Referenced by log10T().

◆ log10() [3/3]

Definition at line 239 of file complex.cpp.

240{ return log10T(z, LN10_INVL); }
static const long double LN10_INVL
Definition: complex.cpp:238

◆ norm()

◆ operator!=() [1/3]

template<class _Tp >
bool _STLP_CALL operator!= ( const _Tp &  __x,
const complex< _Tp > &  __z 
)
inline

Definition at line 722 of file _complex.h.

723{ return __x != __z._M_re || 0 != __z._M_im; }

◆ operator!=() [2/3]

template<class _Tp >
bool _STLP_CALL operator!= ( const complex< _Tp > &  __z,
const _Tp &  __x 
)
inline

Definition at line 718 of file _complex.h.

719{ return __z._M_re != __x || __z._M_im != 0; }

◆ operator!=() [3/3]

template<class _Tp >
bool _STLP_CALL operator!= ( const complex< _Tp > &  __z1,
const complex< _Tp > &  __z2 
)
inline

Definition at line 712 of file _complex.h.

713{ return __z1._M_re != __z2._M_re || __z1._M_im != __z2._M_im; }

◆ operator*() [1/3]

template<class _Tp >
complex< _Tp > _STLP_CALL operator* ( const _Tp &  __x,
const complex< _Tp > &  __z 
)
inline

Definition at line 644 of file _complex.h.

645{ return complex<_Tp>(__x * __z._M_re, __x * __z._M_im); }

◆ operator*() [2/3]

template<class _Tp >
complex< _Tp > _STLP_CALL operator* ( const complex< _Tp > &  __z,
const _Tp &  __x 
)
inline

Definition at line 648 of file _complex.h.

649{ return complex<_Tp>(__z._M_re * __x, __z._M_im * __x); }

◆ operator*() [3/3]

template<class _Tp >
complex< _Tp > _STLP_CALL operator* ( const complex< _Tp > &  __z1,
const complex< _Tp > &  __z2 
)
inline

Definition at line 678 of file _complex.h.

678 {
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);
681}

◆ operator+() [1/4]

template<class _Tp >
complex< _Tp > _STLP_CALL operator+ ( const _Tp &  __x,
const complex< _Tp > &  __z 
)
inline

Definition at line 628 of file _complex.h.

629{ return complex<_Tp>(__x + __z._M_re, __z._M_im); }

◆ operator+() [2/4]

template<class _Tp >
complex< _Tp > _STLP_CALL operator+ ( const complex< _Tp > &  __z)
inline

Definition at line 618 of file _complex.h.

619{ return __z; }

◆ operator+() [3/4]

template<class _Tp >
complex< _Tp > _STLP_CALL operator+ ( const complex< _Tp > &  __z,
const _Tp &  __x 
)
inline

Definition at line 632 of file _complex.h.

633{ return complex<_Tp>(__z._M_re + __x, __z._M_im); }

◆ operator+() [4/4]

template<class _Tp >
complex< _Tp > _STLP_CALL operator+ ( const complex< _Tp > &  __z1,
const complex< _Tp > &  __z2 
)
inline

Definition at line 668 of file _complex.h.

669{ return complex<_Tp>(__z1._M_re + __z2._M_re, __z1._M_im + __z2._M_im); }

◆ operator-() [1/4]

template<class _Tp >
complex< _Tp > _STLP_CALL operator- ( const _Tp &  __x,
const complex< _Tp > &  __z 
)
inline

Definition at line 636 of file _complex.h.

637{ return complex<_Tp>(__x - __z._M_re, -__z._M_im); }

◆ operator-() [2/4]

template<class _Tp >
complex< _Tp > _STLP_CALL operator- ( const complex< _Tp > &  __z)
inline

Definition at line 622 of file _complex.h.

623{ return complex<_Tp>(-__z._M_re, -__z._M_im); }

Referenced by __money_do_put().

◆ operator-() [3/4]

template<class _Tp >
complex< _Tp > _STLP_CALL operator- ( const complex< _Tp > &  __z,
const _Tp &  __x 
)
inline

Definition at line 640 of file _complex.h.

641{ return complex<_Tp>(__z._M_re - __x, __z._M_im); }

◆ operator-() [4/4]

template<class _Tp >
complex< _Tp > _STLP_CALL operator- ( const complex< _Tp > &  __z1,
const complex< _Tp > &  __z2 
)
inline

Definition at line 673 of file _complex.h.

674{ return complex<_Tp>(__z1._M_re - __z2._M_re, __z1._M_im - __z2._M_im); }

◆ operator/() [1/3]

template<class _Tp >
complex< _Tp > _STLP_CALL operator/ ( const _Tp &  __x,
const complex< _Tp > &  __z 
)
inline

Definition at line 652 of file _complex.h.

652 {
653 complex<_Tp> __result;
655 __z._M_re, __z._M_im,
656 __result._M_re, __result._M_im);
657 return __result;
658}
static void _STLP_CALL _div(const value_type &__z1_r, const value_type &__z1_i, const value_type &__z2_r, const value_type &__z2_i, value_type &__res_r, value_type &__res_i)
Definition: _complex.c:44

◆ operator/() [2/3]

template<class _Tp >
complex< _Tp > _STLP_CALL operator/ ( const complex< _Tp > &  __z,
const _Tp &  __x 
)
inline

Definition at line 661 of file _complex.h.

662{ return complex<_Tp>(__z._M_re / __x, __z._M_im / __x); }

◆ operator/() [3/3]

template<class _Tp >
complex< _Tp > _STLP_CALL operator/ ( const complex< _Tp > &  __z1,
const complex< _Tp > &  __z2 
)
inline

Definition at line 685 of file _complex.h.

685 {
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);
690 return __result;
691}

◆ operator<<() [1/4]

template<class _Tp , class _CharT , class _Traits >
_STLP_END_NAMESPACE _STLP_BEGIN_NAMESPACE basic_ostream< _CharT, _Traits > &_STLP_CALL operator<< ( basic_ostream< _CharT, _Traits > &  __os,
const complex< _Tp > &  __z 
)

Definition at line 91 of file _complex.c.

92 {
94 __tmp.flags(__os.flags());
95 __tmp.imbue(__os.getloc());
96 __tmp.precision(__os.precision());
97 __tmp << '(' << __z.real() << ',' << __z.imag() << ')';
98 return __os << __tmp.str();
99}
locale imbue(const locale &)
Definition: _ios.c:69
_String str() const
Definition: _sstream.h:184
fmtflags flags() const
Definition: _ios_base.h:107
locale getloc() const
Definition: _ios_base.h:143
streamsize precision() const
Definition: _ios_base.h:127

◆ operator<<() [2/4]

Definition at line 34 of file complex_io.cpp.

36{ return __os << '(' << __z.real() << ',' << __z.imag() << ')'; }
value_type imag() const
Definition: _complex.h:335
value_type real() const
Definition: _complex.h:334

◆ operator<<() [3/4]

Definition at line 29 of file complex_io.cpp.

31{ return __os << '(' << (double)__z.real() << ',' << (double)__z.imag() << ')'; }
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
value_type real() const
Definition: _complex.h:195
value_type imag() const
Definition: _complex.h:196

◆ operator<<() [4/4]

Definition at line 40 of file complex_io.cpp.

42{ return __os << '(' << __z.real() << ',' << __z.imag() << ')'; }
value_type real() const
Definition: _complex.h:472
value_type imag() const
Definition: _complex.h:473

◆ operator==() [1/3]

template<class _Tp >
bool _STLP_CALL operator== ( const _Tp &  __x,
const complex< _Tp > &  __z 
)
inline

Definition at line 704 of file _complex.h.

705{ return __x == __z._M_re && 0 == __z._M_im; }

◆ operator==() [2/3]

template<class _Tp >
bool _STLP_CALL operator== ( const complex< _Tp > &  __z,
const _Tp &  __x 
)
inline

Definition at line 700 of file _complex.h.

701{ return __z._M_re == __x && __z._M_im == 0; }

◆ operator==() [3/3]

template<class _Tp >
bool _STLP_CALL operator== ( const complex< _Tp > &  __z1,
const complex< _Tp > &  __z2 
)
inline

Definition at line 696 of file _complex.h.

697{ return __z1._M_re == __z2._M_re && __z1._M_im == __z2._M_im; }

◆ operator>>() [1/4]

template<class _Tp , class _CharT , class _Traits >
basic_istream< _CharT, _Traits > &_STLP_CALL operator>> ( basic_istream< _CharT, _Traits > &  __is,
complex< _Tp > &  __z 
)

Definition at line 107 of file _complex.c.

107 {
108 _Tp __re = 0;
109 _Tp __im = 0;
110
111 const ctype<_CharT>& __c_type = *__is._M_ctype_facet();
112
113 const char __punct[4] = "(,)";
114 _CharT __wpunct[3];
115 __c_type.widen(__punct, __punct + 3, __wpunct);
116
117 _CharT __c;
118
119 __is >> __c;
120 if (_Traits::eq(__c, __wpunct[0])) { // Left paren
121 __is >> __re >> __c;
122 if (_Traits::eq(__c, __wpunct[1])) // Comma
123 __is >> __im >> __c;
124 if (!_Traits::eq(__c, __wpunct[2])) // Right paren
125 __is.setstate(ios_base::failbit);
126 }
127 else {
128 __is.putback(__c);
129 __is >> __re;
130 }
131
132 if (__is)
133 __z = complex<_Tp>(__re, __im);
134 return __is;
135}
const ctype< char_type > * _M_ctype_facet() const
Definition: _ios.h:121
void setstate(iostate __state)
Definition: _ios.h:95
_Self & putback(char_type __c)
Definition: _istream.c:422
Definition: _ctype.h:58
#define __c
Definition: schilyio.h:209

◆ operator>>() [2/4]

Definition at line 74 of file complex_io.cpp.

74 {
75 double __re = 0;
76 double __im = 0;
77
78 char __c;
79
80 __is >> __c;
81 if (__c == '(') {
82 __is >> __re >> __c;
83 if (__c == ',')
84 __is >> __im >> __c;
85 if (__c != ')')
86 __is.setstate(ios_base::failbit);
87 }
88 else {
89 __is.putback(__c);
90 __is >> __re;
91 }
92
93 if (__is)
94 __z = complex<double>(__re, __im);
95 return __is;
96}

◆ operator>>() [3/4]

Definition at line 48 of file complex_io.cpp.

48 {
49 float __re = 0;
50 float __im = 0;
51
52 char __c;
53
54 __is >> __c;
55 if (__c == '(') {
56 __is >> __re >> __c;
57 if (__c == ',')
58 __is >> __im >> __c;
59 if (__c != ')')
60 __is.setstate(ios_base::failbit);
61 }
62 else {
63 __is.putback(__c);
64 __is >> __re;
65 }
66
67 if (__is)
68 __z = complex<float>(__re, __im);
69 return __is;
70}

◆ operator>>() [4/4]

Definition at line 101 of file complex_io.cpp.

101 {
102 long double __re = 0;
103 long double __im = 0;
104
105 char __c;
106
107 __is >> __c;
108 if (__c == '(') {
109 __is >> __re >> __c;
110 if (__c == ',')
111 __is >> __im >> __c;
112 if (__c != ')')
113 __is.setstate(ios_base::failbit);
114 }
115 else {
116 __is.putback(__c);
117 __is >> __re;
118 }
119
120 if (__is)
121 __z = complex<long double>(__re, __im);
122 return __is;
123}

◆ polar() [1/5]

template<class _Tp >
complex< _Tp > _STLP_CALL polar ( const _Tp &  __rho)

Definition at line 749 of file _complex.h.

750{ return complex<_Tp>(__rho, 0); }

Referenced by polar().

◆ polar() [2/5]

template<class _Tp >
complex< _Tp > _STLP_CALL polar ( const _Tp &  __rho,
const _Tp &  __phi 
)

Definition at line 777 of file _complex.h.

777 {
778 complex<double> __tmp = polar(double(__rho), double(__phi));
779 return complex<_Tp>(_Tp(__tmp.real()), _Tp(__tmp.imag()));
780}
complex< _Tp > _STLP_CALL polar(const _Tp &__rho)
Definition: _complex.h:749

◆ polar() [3/5]

Definition at line 73 of file complex.cpp.

74{ return complex<double>(__rho * ::cos(__phi), __rho * ::sin(__phi)); }
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)

◆ polar() [4/5]

Definition at line 70 of file complex.cpp.

71{ return complex<float>(__rho * ::cos(__phi), __rho * ::sin(__phi)); }

◆ polar() [5/5]

Definition at line 78 of file complex.cpp.

79{ return complex<long double>(__rho * ::cos(__phi), __rho * ::sin(__phi)); }

◆ pow() [1/12]

Definition at line 326 of file complex.cpp.

327{ return powT(a, b); }
static complex< _Tp > powT(const _Tp &a, const complex< _Tp > &b)
Definition: complex.cpp:267
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ pow() [2/12]

Definition at line 323 of file complex.cpp.

324{ return powT(a, b); }

◆ pow() [3/12]

_STLP_DECLSPEC complex< double > _STLP_CALL pow ( const complex< double > &  z_in,
int  n 
)

Definition at line 320 of file complex.cpp.

321{ return powT(z_in, n); }
GLdouble n
Definition: glext.h:7729

◆ pow() [4/12]

Definition at line 314 of file complex.cpp.

315{ return powT(a, b); }

◆ pow() [5/12]

Definition at line 311 of file complex.cpp.

312{ return powT(a, b); }

◆ pow() [6/12]

_STLP_DECLSPEC complex< float > _STLP_CALL pow ( const complex< float > &  z_in,
int  n 
)

Definition at line 308 of file complex.cpp.

309{ return powT(z_in, n); }

◆ pow() [7/12]

Definition at line 342 of file complex.cpp.

344{ return powT(a, b); }

◆ pow() [8/12]

Definition at line 338 of file complex.cpp.

340{ return powT(a, b); }

◆ pow() [9/12]

Definition at line 335 of file complex.cpp.

336{ return powT(z_in, n); }

◆ pow() [10/12]

Definition at line 317 of file complex.cpp.

318{ return powT(a, b); }

◆ pow() [11/12]

Definition at line 305 of file complex.cpp.

306{ return powT(a, b); }

◆ pow() [12/12]

Definition at line 330 of file complex.cpp.

332{ return powT(a, b); }

◆ real()

template<class _Tp >
_Tp _STLP_CALL real ( const complex< _Tp > &  __z)
inline

Definition at line 727 of file _complex.h.

728{ return __z._M_re; }

◆ sin() [1/3]

Definition at line 76 of file complex_trig.cpp.

77{ return sinT(z); }
static complex< _Tp > sinT(const complex< _Tp > &z)

◆ sin() [2/3]

◆ sin() [3/3]

Definition at line 80 of file complex_trig.cpp.

81{ return sinT(z); }

◆ sinh() [1/3]

Definition at line 140 of file complex_trig.cpp.

141{ return sinhT(z); }
static complex< _Tp > sinhT(const complex< _Tp > &z)

◆ sinh() [2/3]

◆ sinh() [3/3]

Definition at line 144 of file complex_trig.cpp.

145{ return sinhT(z); }

◆ sqrt() [1/3]

Definition at line 191 of file complex.cpp.

191{ return sqrtT(z); }
static complex< _Tp > sqrtT(const complex< _Tp > &z)
Definition: complex.cpp:167

◆ sqrt() [2/3]

◆ sqrt() [3/3]

Definition at line 195 of file complex.cpp.

195{ return sqrtT(z); }

◆ tan() [1/3]

Definition at line 121 of file complex_trig.cpp.

122{ return tanT(z, double_limit); }
static complex< _Tp > tanT(const complex< _Tp > &z, const _Tp &Tp_limit)
static const double double_limit

◆ tan() [2/3]

◆ tan() [3/3]

Definition at line 125 of file complex_trig.cpp.

126{ return tanT(z, ldouble_limit); }
static const long double ldouble_limit

◆ tanh() [1/3]

Definition at line 184 of file complex_trig.cpp.

185{ return tanhT(z, double_limit); }
static complex< _Tp > tanhT(const complex< _Tp > &z, const _Tp &Tp_limit)

◆ tanh() [2/3]

Definition at line 181 of file complex_trig.cpp.

182{ return tanhT(z, float_limit); }

Referenced by _CItanh(), rpn_tanh(), tanhf(), and ValarrayTest::transcendentals().

◆ tanh() [3/3]

Definition at line 188 of file complex_trig.cpp.

189{ return tanhT(z, ldouble_limit); }