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
1295  { // insert a complex<_Ty>
1296  const ctype<_Elem>& _Ctype_fac = _USE(_Ostr.getloc(), ctype<_Elem>);
1298 
1299  _Sstr.flags(_Ostr.flags());
1300  _Sstr.imbue(_Ostr.getloc());
1301  _Sstr.precision(_Ostr.precision());
1302  _Sstr << _Ctype_fac.widen('(') << real(_Right)
1303  << _Ctype_fac.widen(',') << imag(_Right)
1304  << _Ctype_fac.widen(')');
1305 
1306  basic_string<_Elem, _Tr, allocator<_Elem> > _Str = _Sstr.str();
1307  return (_Ostr << _Str.c_str());
1308  }
_Ret_z_ const _Elem * c_str() const _NOEXCEPT
Definition: xstring:3001
#define _USE(loc, fac)
Definition: xlocale:499
_Tmp imag(_Tmp.imag()*_Right)
streamsize __CLR_OR_THIS_CALL precision() const
Definition: xiosbase:408
Definition: iosfwd:592
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
fmtflags __CLR_OR_THIS_CALL flags() const
Definition: xiosbase:375
_Tmp real(_Tmp.real()+_Right)
Definition: xlocale:2077
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: xlocale:2126
Definition: xstring:1866
template<class _Ty , class _Elem , class _Tr >
basic_istream<_Elem, _Tr>& operator>> ( basic_istream< _Elem, _Tr > &  _Istr,
complex< _Ty > &  _Right 
)
inline
1254  { // extract a complex<_Ty>
1255  typedef complex<_Ty> _Myt;
1256  const ctype<_Elem>& _Ctype_fac = _USE(_Istr.getloc(), ctype<_Elem>);
1257  _Elem _Ch = 0;
1258  long double _Real = 0;
1259  long double _Imag = 0;
1260 
1261  if (_Istr >> _Ch && _Ch != _Ctype_fac.widen('('))
1262  { // no leading '(', treat as real only
1263  _Istr.putback(_Ch);
1264  _Istr >> _Real;
1265  _Imag = 0;
1266  }
1267  else if (_Istr >> _Real >> _Ch && _Ch != _Ctype_fac.widen(','))
1268  if (_Ch == _Ctype_fac.widen(')'))
1269  _Imag = 0; // (real)
1270  else
1271  { // no trailing ')' after real, treat as bad field
1272  _Istr.putback(_Ch);
1273  _Istr.setstate(ios_base::failbit);
1274  }
1275  else if (_Istr >> _Imag >> _Ch && _Ch != _Ctype_fac.widen(')'))
1276  { // no imag or trailing ')', treat as bad field
1277  _Istr.putback(_Ch);
1278  _Istr.setstate(ios_base::failbit);
1279  }
1280 
1281  if (!_Istr.fail())
1282  { // store valid result
1283  _Ty _Tyreal((_Ty)_Real), _Tyimag((_Ty)_Imag);
1284  _Right = _Myt(_Tyreal, _Tyimag);
1285  }
1286  return (_Istr);
1287  }
Definition: complex:46
static constexpr _Iostate failbit
Definition: xiosbase:88
#define _USE(loc, fac)
Definition: xlocale:499
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:432
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
Definition: xlocale:2077
_Myt &__CLR_OR_THIS_CALL putback(_Elem _Ch)
Definition: istream:777
_Elem __CLR_OR_THIS_CALL widen(char _Byte) const
Definition: xlocale:2126
bool __CLR_OR_THIS_CALL fail() const
Definition: xiosbase:346
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Reraise=false)
Definition: ios:55

Variable Documentation

_STD_BEGIN typedef _CSTD _C_double_complex _Dcomplex_value