STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Namespaces | Macros | Typedefs | Functions | Variables
complex File Reference
#include <ymath.h>
#include <ccomplex>
#include <cmath>
#include <sstream>
#include <xcomplex>

Classes

struct  _C_double_complex
 
struct  _C_float_complex
 
struct  _C_ldouble_complex
 
class  complex< _Ty >
 
class  _Ctraits< _Ty >
 
class  _Ctraits< long double >
 
class  _Ctraits< double >
 
class  _Ctraits< float >
 
struct  _Complex_value< _Ty >
 
class  _Complex_base< _Ty, _Valbase >
 
class  complex< float >
 
class  complex< double >
 
class  complex< long double >
 
class  complex< _Ty >
 

Namespaces

 literals
 
 literals::complex_literals
 

Macros

#define _COMPLEX_
 
#define _C_COMPLEX_T
 
#define _RE   0
 
#define _IM   1
 
#define _CMPLX(T)   complex<T >
 
#define _CTR(T)   _Ctraits<T >
 
#define _TMPLT(T)   template<class T >
 

Typedefs

typedef struct _C_double_complex _C_double_complex
 
typedef struct _C_float_complex _C_float_complex
 
typedef struct _C_ldouble_complex _C_ldouble_complex
 
typedef _CSTD _C_float_complex _Fcomplex_value
 
typedef _CSTD _C_ldouble_complex _Lcomplex_value
 

Functions

template<class _Ty , class _Elem , class _Tr >
basic_istream< _Elem, _Tr > & operator>> (basic_istream< _Elem, _Tr > &_Istr, complex< _Ty > &_Right)
 
template<class _Ty , class _Elem , class _Tr >
basic_ostream< _Elem, _Tr > & operator<< (basic_ostream< _Elem, _Tr > &_Ostr, const complex< _Ty > &_Right)
 
constexpr complex< long double > literals::complex_literals::operator""il (long double _Val)
 
constexpr complex< long double > literals::complex_literals::operator""il (unsigned long long _Val)
 
constexpr complex< double > literals::complex_literals::operator""i (long double _Val)
 
constexpr complex< double > literals::complex_literals::operator""i (unsigned long long _Val)
 
constexpr complex< float > literals::complex_literals::operator""if (long double _Val)
 
constexpr complex< float > literals::complex_literals::operator""if (unsigned long long _Val)
 

Variables

_STD_BEGIN typedef _CSTD _C_double_complex _Dcomplex_value
 

Macro Definition Documentation

#define _C_COMPLEX_T
#define _CMPLX (   T)    complex<T >
#define _COMPLEX_
#define _CTR (   T)    _Ctraits<T >
#define _IM   1
#define _RE   0
#define _TMPLT (   T)    template<class T >

Typedef Documentation

Function Documentation

template<class _Ty , class _Elem , class _Tr >
basic_ostream<_Elem, _Tr>& operator<< ( basic_ostream< _Elem, _Tr > &  _Ostr,
const complex< _Ty > &  _Right 
)
inline
1299  { // insert a complex<_Ty>
1300  const ctype<_Elem>& _Ctype_fac = _USE(_Ostr.getloc(), ctype<_Elem>);
1302 
1303  _Sstr.flags(_Ostr.flags());
1304  _Sstr.imbue(_Ostr.getloc());
1305  _Sstr.precision(_Ostr.precision());
1306  _Sstr << _Ctype_fac.widen('(') << real(_Right)
1307  << _Ctype_fac.widen(',') << imag(_Right)
1308  << _Ctype_fac.widen(')');
1309 
1310  basic_string<_Elem, _Tr, allocator<_Elem> > _Str = _Sstr.str();
1311  return (_Ostr << _Str.c_str());
1312  }
#define _USE(loc, fac)
Definition: xlocale:547
_Tmp imag(_Tmp.imag()*_Right)
streamsize __CLR_OR_THIS_CALL precision() const
Definition: xiosbase:409
Definition: iosfwd:646
const _Elem * c_str() const _NOEXCEPT
Definition: xstring:1741
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:376
_Tmp real(_Tmp.real()+_Right)
Definition: xlocale:2115
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: xlocale:2164
Definition: xstring:21
template<class _Ty , class _Elem , class _Tr >
basic_istream<_Elem, _Tr>& operator>> ( basic_istream< _Elem, _Tr > &  _Istr,
complex< _Ty > &  _Right 
)
inline
1258  { // extract a complex<_Ty>
1259  typedef complex<_Ty> _Myt;
1260  const ctype<_Elem>& _Ctype_fac = _USE(_Istr.getloc(), ctype<_Elem>);
1261  _Elem _Ch = 0;
1262  long double _Real = 0;
1263  long double _Imag = 0;
1264 
1265  if (_Istr >> _Ch && _Ch != _Ctype_fac.widen('('))
1266  { // no leading '(', treat as real only
1267  _Istr.putback(_Ch);
1268  _Istr >> _Real;
1269  _Imag = 0;
1270  }
1271  else if (_Istr >> _Real >> _Ch && _Ch != _Ctype_fac.widen(','))
1272  if (_Ch == _Ctype_fac.widen(')'))
1273  _Imag = 0; // (real)
1274  else
1275  { // no trailing ')' after real, treat as bad field
1276  _Istr.putback(_Ch);
1277  _Istr.setstate(ios_base::failbit);
1278  }
1279  else if (_Istr >> _Imag >> _Ch && _Ch != _Ctype_fac.widen(')'))
1280  { // no imag or trailing ')', treat as bad field
1281  _Istr.putback(_Ch);
1282  _Istr.setstate(ios_base::failbit);
1283  }
1284 
1285  if (!_Istr.fail())
1286  { // store valid result
1287  _Ty _Tyreal((_Ty)_Real), _Tyimag((_Ty)_Imag);
1288  _Right = _Myt(_Tyreal, _Tyimag);
1289  }
1290  return (_Istr);
1291  }
Definition: complex:50
static constexpr _Iostate failbit
Definition: xiosbase:89
#define _USE(loc, fac)
Definition: xlocale:547
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
Definition: xlocale:2115
_Myt &__CLR_OR_THIS_CALL putback(_Elem _Ch)
Definition: istream:788
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: xlocale:2164
bool __CLR_OR_THIS_CALL fail() const
Definition: xiosbase:347
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:56

Variable Documentation

_STD_BEGIN typedef _CSTD _C_double_complex _Dcomplex_value