STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Static Public Member Functions | List of all members
_Ctraits< _Ty > Class Template Reference

Static Public Member Functions

static _Ty _Flt_eps ()
 
static _Ty _Flt_max ()
 
static _Ty _Cosh (_Ty _Left, _Ty _Right)
 
static short _Exp (_Ty *_Pleft, _Ty _Right, short _Exponent)
 
static _Ty _Infv (_Ty)
 
static bool _Isinf (_Ty _Left)
 
static bool _Isnan (_Ty _Left)
 
static _Ty _Nanv (_Ty)
 
static _Ty _Sinh (_Ty _Left, _Ty _Right)
 
static _Ty asinh (_Ty _Left)
 
static _Ty atan2 (_Ty _Yval, _Ty _Xval)
 
static _Ty cos (_Ty _Left)
 
static _Ty exp (_Ty _Left)
 
static _Ty ldexp (_Ty _Left, int _Exponent)
 
static _Ty log (_Ty _Left)
 
static _Ty log1p (_Ty _Left)
 
static _Ty pow (_Ty _Left, _Ty _Right)
 
static _Ty sin (_Ty _Left)
 
static _Ty sqrt (_Ty _Left)
 
static _Ty tan (_Ty _Left)
 

Member Function Documentation

template<class _Ty >
static _Ty _Ctraits< _Ty >::_Cosh ( _Ty  _Left,
_Ty  _Right 
)
inlinestatic
73  { // return cosh(_Left) * _Right
74  return (_CSTD _Cosh((double)_Left, (double)_Right));
75  }
static _Ty _Cosh(_Ty _Left, _Ty _Right)
Definition: complex:72
#define _CSTD
Definition: yvals.h:559
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty >
static short _Ctraits< _Ty >::_Exp ( _Ty *  _Pleft,
_Ty  _Right,
short  _Exponent 
)
inlinestatic
78  { // compute exp(*_Pleft) * _Right * 2 ^ _Exponent
79  double _Tmp = (double)*_Pleft;
80  short _Ans = _CSTD _Exp(&_Tmp, (double)_Right, _Exponent);
81  *_Pleft = (_Ty)_Tmp;
82  return (_Ans);
83  }
#define _CSTD
Definition: yvals.h:559
static short _Exp(_Ty *_Pleft, _Ty _Right, short _Exponent)
Definition: complex:77
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty >
static _Ty _Ctraits< _Ty >::_Flt_eps ( )
inlinestatic
63  { // get epsilon
65  }
Definition: limits:79
template<class _Ty >
static _Ty _Ctraits< _Ty >::_Flt_max ( )
inlinestatic
68  { // get max
69  return ((numeric_limits<_Ty>::max)());
70  }
Definition: limits:79
template<class _Ty >
static _Ty _Ctraits< _Ty >::_Infv ( _Ty  )
inlinestatic
86  { // return infinity
87  return (_CSTD _Inf._Double);
88  }
_CRTIMP2_PURE _Dconst _Inf
double _Double
Definition: ymath.h:39
#define _CSTD
Definition: yvals.h:559
template<class _Ty >
static bool _Ctraits< _Ty >::_Isinf ( _Ty  _Left)
inlinestatic
91  { // test for infinity
92  double _Tmp = (double)_Left;
93  return (_CSTD _Dtest(&_Tmp) == _INFCODE);
94  }
#define _CSTD
Definition: yvals.h:559
_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _Dtest(double *)
#define _INFCODE
Definition: math.h:110
template<class _Ty >
static bool _Ctraits< _Ty >::_Isnan ( _Ty  _Left)
inlinestatic
97  { // test for NaN
98  double _Tmp = (double)_Left;
99  return (_CSTD _Dtest(&_Tmp) == _NANCODE);
100  }
#define _NANCODE
Definition: math.h:111
#define _CSTD
Definition: yvals.h:559
_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _Dtest(double *)
template<class _Ty >
static _Ty _Ctraits< _Ty >::_Nanv ( _Ty  )
inlinestatic
103  { // return NaN
104  return (_CSTD _Nan._Double);
105  }
_CRTIMP2_PURE _Dconst _Nan
double _Double
Definition: ymath.h:39
#define _CSTD
Definition: yvals.h:559
template<class _Ty >
static _Ty _Ctraits< _Ty >::_Sinh ( _Ty  _Left,
_Ty  _Right 
)
inlinestatic
108  { // return sinh(_Left) * _Right
109  return (_CSTD _Sinh((double)_Left, (double)_Right));
110  }
static _Ty _Sinh(_Ty _Left, _Ty _Right)
Definition: complex:107
#define _CSTD
Definition: yvals.h:559
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty >
static _Ty _Ctraits< _Ty >::asinh ( _Ty  _Left)
inlinestatic
113  { // return asinh(_Left)
114  static const _Ty _Ln2 = 0.69314718055994530941723212145817658L;
115 
116  bool _Neg = _Left < 0;
117  _Ty _Ans;
118 
119  if (_Neg)
120  _Left = -_Left;
121  if (_Left < 2 / _Flt_eps())
122  _Ans = log1p(_Left
123  + _Left * _Left / (1 + sqrt(_Left * _Left + 1)));
124  else
125  _Ans = log(_Left) + _Ln2;
126  return (_Neg ? -_Ans : _Ans);
127  }
static _Ty sqrt(_Ty _Left)
Definition: complex:177
static _Ty log(_Ty _Left)
Definition: complex:149
static _Ty log1p(_Ty _Left)
Definition: complex:154
static _Ty _Flt_eps()
Definition: complex:62
template<class _Ty >
static _Ty _Ctraits< _Ty >::atan2 ( _Ty  _Yval,
_Ty  _Xval 
)
inlinestatic
130  { // return atan(_Yval / _Xval)
131  return (_CSTD atan2((double)_Yval, (double)_Xval));
132  }
static _Ty atan2(_Ty _Yval, _Ty _Xval)
Definition: complex:129
#define _CSTD
Definition: yvals.h:559
template<class _Ty >
static _Ty _Ctraits< _Ty >::cos ( _Ty  _Left)
inlinestatic
135  { // return cos(_Left)
136  return (_CSTD cos((double)_Left));
137  }
#define _CSTD
Definition: yvals.h:559
static _Ty cos(_Ty _Left)
Definition: complex:134
template<class _Ty >
static _Ty _Ctraits< _Ty >::exp ( _Ty  _Left)
inlinestatic
140  { // return exp(_Left)
141  return (_CSTD exp((double)_Left));
142  }
static _Ty exp(_Ty _Left)
Definition: complex:139
#define _CSTD
Definition: yvals.h:559
template<class _Ty >
static _Ty _Ctraits< _Ty >::ldexp ( _Ty  _Left,
int  _Exponent 
)
inlinestatic
145  { // return _Left * 2 ^ _Exponent
146  return (_CSTD ldexp((double)_Left, _Exponent));
147  }
#define _CSTD
Definition: yvals.h:559
static _Ty ldexp(_Ty _Left, int _Exponent)
Definition: complex:144
template<class _Ty >
static _Ty _Ctraits< _Ty >::log ( _Ty  _Left)
inlinestatic
150  { // return log(_Left)
151  return (_CSTD log((double)_Left));
152  }
static _Ty log(_Ty _Left)
Definition: complex:149
#define _CSTD
Definition: yvals.h:559
template<class _Ty >
static _Ty _Ctraits< _Ty >::log1p ( _Ty  _Left)
inlinestatic
155  { // return log(1 + _Left)
156  if (_Left < -1)
157  return (_Nanv(_Left));
158  else if (_Left == 0)
159  return (_Left);
160  else
161  { // compute log(1 + _Left) with fixup for small _Left
162  _Ty _Leftp1 = 1 + _Left;
163  return (log(_Leftp1) - ((_Leftp1 - 1) - _Left) / _Leftp1);
164  }
165  }
static _Ty _Nanv(_Ty)
Definition: complex:102
static _Ty log(_Ty _Left)
Definition: complex:149
template<class _Ty >
static _Ty _Ctraits< _Ty >::pow ( _Ty  _Left,
_Ty  _Right 
)
inlinestatic
168  { // return _Left ^ _Right
169  return (_CSTD pow((double)_Left, (double)_Right));
170  }
static _Ty pow(_Ty _Left, _Ty _Right)
Definition: complex:167
#define _CSTD
Definition: yvals.h:559
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty >
static _Ty _Ctraits< _Ty >::sin ( _Ty  _Left)
inlinestatic
173  { // return sin(_Left)
174  return (_CSTD sin((double)_Left));
175  }
#define _CSTD
Definition: yvals.h:559
static _Ty sin(_Ty _Left)
Definition: complex:172
template<class _Ty >
static _Ty _Ctraits< _Ty >::sqrt ( _Ty  _Left)
inlinestatic
178  { // return sqrt(_Left)
179  return (_CSTD sqrt((double)_Left));
180  }
static _Ty sqrt(_Ty _Left)
Definition: complex:177
#define _CSTD
Definition: yvals.h:559
template<class _Ty >
static _Ty _Ctraits< _Ty >::tan ( _Ty  _Left)
inlinestatic
183  { // return tan(_Left)
184  return (_CSTD tan((double)_Left));
185  }
static _Ty tan(_Ty _Left)
Definition: complex:182
#define _CSTD
Definition: yvals.h:559

The documentation for this class was generated from the following file: