Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

527 lines
24 KiB

  1. // xcomplex internal header
  2. // TEMPLATE FUNCTION imag
  3. _TMPLT(_Ty) inline
  4. _Ty __cdecl imag(const _CMPLX(_Ty)& _X)
  5. {return (_X.imag()); }
  6. // TEMPLATE FUNCTION real
  7. _TMPLT(_Ty) inline
  8. _Ty __cdecl real(const _CMPLX(_Ty)& _X)
  9. {return (_X.real()); }
  10. // TEMPLATE FUNCTION _Fabs
  11. _TMPLT(_Ty) inline
  12. _Ty __cdecl _Fabs(const _CMPLX(_Ty)& _X, int *_Pexp)
  13. {*_Pexp = 0;
  14. _Ty _A = real(_X);
  15. _Ty _B = imag(_X);
  16. if (_CTR(_Ty)::_Isnan(_A))
  17. return (_A);
  18. else if (_CTR(_Ty)::_Isnan(_B))
  19. return (_B);
  20. else
  21. {if (_A < 0)
  22. _A = -_A;
  23. if (_B < 0)
  24. _B = -_B;
  25. if (_A < _B)
  26. {_Ty _W = _A;
  27. _A = _B, _B = _W; }
  28. if (_A == 0 || _CTR(_Ty)::_Isinf(_A))
  29. return (_A);
  30. if (1 <= _A)
  31. *_Pexp = 2, _A = _A * 0.25, _B = _B * 0.25;
  32. else
  33. *_Pexp = -2, _A = _A * 4, _B = _B * 4;
  34. _Ty _W = _A - _B;
  35. if (_W == _A)
  36. return (_A);
  37. else if (_B < _W)
  38. {const _Ty _Q = _A / _B;
  39. return (_A + _B
  40. / (_Q + _CTR(_Ty)::sqrt(_Q * _Q + 1))); }
  41. else
  42. {static const _Ty _R2 = (const _Ty)1.4142135623730950488L;
  43. static const _Ty _Xh = (const _Ty)2.4142L;
  44. static const _Ty _Xl = (const _Ty)0.0000135623730950488016887L;
  45. const _Ty _Q = _W / _B;
  46. const _Ty _R = (_Q + 2) * _Q;
  47. const _Ty _S = _R / (_R2 + _CTR(_Ty)::sqrt(_R + 2))
  48. + _Xl + _Q + _Xh;
  49. return (_A + _B / _S); }}}
  50. // TEMPLATE FUNCTION operator+
  51. _TMPLT(_Ty) inline
  52. _CMPLX(_Ty) __cdecl operator+(const _CMPLX(_Ty)& _L,
  53. const _CMPLX(_Ty)& _R)
  54. {_CMPLX(_Ty) _W(_L);
  55. return (_W += _R); }
  56. _TMPLT(_Ty) inline
  57. _CMPLX(_Ty) __cdecl operator+(const _CMPLX(_Ty)& _L, const _Ty& _R)
  58. {_CMPLX(_Ty) _W(_L);
  59. _W.real(_W.real() + _R);
  60. return (_W); }
  61. _TMPLT(_Ty) inline
  62. _CMPLX(_Ty) __cdecl operator+(const _Ty& _L, const _CMPLX(_Ty)& _R)
  63. {_CMPLX(_Ty) _W(_L);
  64. return (_W += _R); }
  65. // TEMPLATE FUNCTION operator-
  66. _TMPLT(_Ty) inline
  67. _CMPLX(_Ty) __cdecl operator-(const _CMPLX(_Ty)& _L,
  68. const _CMPLX(_Ty)& _R)
  69. {_CMPLX(_Ty) _W(_L);
  70. return (_W -= _R); }
  71. _TMPLT(_Ty) inline
  72. _CMPLX(_Ty) __cdecl operator-(const _CMPLX(_Ty)& _L, const _Ty& _R)
  73. {_CMPLX(_Ty) _W(_L);
  74. _W.real(_W.real() - _R);
  75. return (_W); }
  76. _TMPLT(_Ty) inline
  77. _CMPLX(_Ty) __cdecl operator-(const _Ty& _L, const _CMPLX(_Ty)& _R)
  78. {_CMPLX(_Ty) _W(_L);
  79. return (_W -= _R); }
  80. // TEMPLATE FUNCTION operator*
  81. _TMPLT(_Ty) inline
  82. _CMPLX(_Ty) __cdecl operator*(const _CMPLX(_Ty)& _L,
  83. const _CMPLX(_Ty)& _R)
  84. {_CMPLX(_Ty) _W(_L);
  85. return (_W *= _R); }
  86. _TMPLT(_Ty) inline
  87. _CMPLX(_Ty) __cdecl operator*(const _CMPLX(_Ty)& _L, const _Ty& _R)
  88. {_CMPLX(_Ty) _W(_L);
  89. _W.real(_W.real() * _R);
  90. _W.imag(_W.imag() * _R);
  91. return (_W); }
  92. _TMPLT(_Ty) inline
  93. _CMPLX(_Ty) __cdecl operator*(const _Ty& _L, const _CMPLX(_Ty)& _R)
  94. {_CMPLX(_Ty) _W(_L);
  95. return (_W *= _R); }
  96. // TEMPLATE FUNCTION operator/
  97. _TMPLT(_Ty) inline
  98. _CMPLX(_Ty) __cdecl operator/(const _CMPLX(_Ty)& _L,
  99. const _CMPLX(_Ty)& _R)
  100. {_CMPLX(_Ty) _W(_L);
  101. return (_W /= _R); }
  102. _TMPLT(_Ty) inline
  103. _CMPLX(_Ty) __cdecl operator/(const _CMPLX(_Ty)& _L, const _Ty& _R)
  104. {_CMPLX(_Ty) _W(_L);
  105. _W.real(_W.real() / _R);
  106. _W.imag(_W.imag() / _R);
  107. return (_W); }
  108. _TMPLT(_Ty) inline
  109. _CMPLX(_Ty) __cdecl operator/(const _Ty& _L, const _CMPLX(_Ty)& _R)
  110. {_CMPLX(_Ty) _W(_L);
  111. return (_W /= _R); }
  112. // TEMPLATE FUNCTION UNARY operator+
  113. _TMPLT(_Ty) inline
  114. _CMPLX(_Ty) __cdecl operator+(const _CMPLX(_Ty)& _L)
  115. {return (_CMPLX(_Ty)(_L)); }
  116. // TEMPLATE FUNCTION UNARY operator-
  117. _TMPLT(_Ty) inline
  118. _CMPLX(_Ty) __cdecl operator-(const _CMPLX(_Ty)& _L)
  119. {return (_CMPLX(_Ty)(-real(_L), -imag(_L))); }
  120. // TEMPLATE FUNCTION operator==
  121. _TMPLT(_Ty) inline
  122. bool __cdecl operator==(const _CMPLX(_Ty)& _L, const _CMPLX(_Ty)& _R)
  123. {return (real(_L) == real(_R) && imag(_L) == imag(_R)); }
  124. _TMPLT(_Ty) inline
  125. bool __cdecl operator==(const _CMPLX(_Ty)& _L, const _Ty& _R)
  126. {return (real(_L) == _R && imag(_L) == 0); }
  127. _TMPLT(_Ty) inline
  128. bool __cdecl operator==(const _Ty& _L, const _CMPLX(_Ty)& _R)
  129. {return (_L == real(_R) && 0 == imag(_R)); }
  130. _TMPLT(_Ty) inline
  131. bool __cdecl operator!=(const _CMPLX(_Ty)& _L, const _CMPLX(_Ty)& _R)
  132. {return (!(_L == _R)); }
  133. _TMPLT(_Ty) inline
  134. bool __cdecl operator!=(const _CMPLX(_Ty)& _L, const _Ty& _R)
  135. {return (!(_L == _R)); }
  136. _TMPLT(_Ty) inline
  137. bool __cdecl operator!=(const _Ty& _L, const _CMPLX(_Ty)& _R)
  138. {return (!(_L == _R)); }
  139. // TEMPLATE FUNCTION abs
  140. _TMPLT(_Ty) inline
  141. _Ty __cdecl abs(const _CMPLX(_Ty)& _X)
  142. {int _Xexp;
  143. _Ty _Rho = _Fabs(_X, &_Xexp);
  144. if (_Xexp == 0)
  145. return (_Rho);
  146. else
  147. return (_CTR(_Ty)::ldexp(_Rho, _Xexp)); }
  148. // TEMPLATE FUNCTION arg
  149. _TMPLT(_Ty) inline
  150. _Ty __cdecl arg(const _CMPLX(_Ty)& _X)
  151. {return (_CTR(_Ty)::atan2(imag(_X), real(_X))); }
  152. // TEMPLATE FUNCTION conjg
  153. _TMPLT(_Ty) inline
  154. _CMPLX(_Ty) __cdecl conj(const _CMPLX(_Ty)& _X)
  155. {return (_CMPLX(_Ty)(real(_X), -imag(_X))); }
  156. // TEMPLATE FUNCTION cos
  157. _TMPLT(_Ty) inline
  158. _CMPLX(_Ty) __cdecl cos(const _CMPLX(_Ty)& _X)
  159. {return (_CMPLX(_Ty)(
  160. _CTR(_Ty)::_Cosh(imag(_X), _CTR(_Ty)::cos(real(_X))),
  161. -_CTR(_Ty)::_Sinh(imag(_X),
  162. _CTR(_Ty)::sin(real(_X))))); }
  163. // TEMPLATE FUNCTION cosh
  164. _TMPLT(_Ty) inline
  165. _CMPLX(_Ty) __cdecl cosh(const _CMPLX(_Ty)& _X)
  166. {return (_CMPLX(_Ty)(
  167. _CTR(_Ty)::_Cosh(real(_X), _CTR(_Ty)::cos(imag(_X))),
  168. _CTR(_Ty)::_Sinh(real(_X), _CTR(_Ty)::sin(imag(_X))))); }
  169. // TEMPLATE FUNCTION exp
  170. _TMPLT(_Ty) inline
  171. _CMPLX(_Ty) __cdecl exp(const _CMPLX(_Ty)& _X)
  172. {_Ty _Re(real(_X)), _Im(real(_X));
  173. _CTR(_Ty)::_Exp(&_Re, _CTR(_Ty)::cos(imag(_X)), 0);
  174. _CTR(_Ty)::_Exp(&_Im, _CTR(_Ty)::sin(imag(_X)), 0);
  175. return (_CMPLX(_Ty)(_Re, _Im)); }
  176. // TEMPLATE FUNCTION log
  177. _TMPLT(_Ty) inline
  178. _CMPLX(_Ty) __cdecl log(const _CMPLX(_Ty)& _X)
  179. {int _Xexp;
  180. _Ty _Rho = _Fabs(_X, &_Xexp);
  181. if (_CTR(_Ty)::_Isnan(_Rho))
  182. return (_CMPLX(_Ty)(_Rho, _Rho));
  183. else
  184. {static const _Ty _Cm = 22713.0 / 32768.0;
  185. static const _Ty _Cl = (const _Ty)1.428606820309417232e-6L;
  186. _Ty _Xn = _Xexp;
  187. _CMPLX(_Ty) _W(_Rho == 0 ? -_CTR(_Ty)::_Infv(_Rho)
  188. : _CTR(_Ty)::_Isinf(_Rho) ? _Rho
  189. : _CTR(_Ty)::log(_Rho) + _Xn * _Cl + _Xn * _Cm,
  190. _CTR(_Ty)::atan2(imag(_X), real(_X)));
  191. return (_W); }}
  192. // TEMPLATE FUNCTION log10
  193. _TMPLT(_Ty) inline
  194. _CMPLX(_Ty) __cdecl log10(const _CMPLX(_Ty)& _X)
  195. {return (log(_X) * (_Ty)0.4342944819032518276511289L); }
  196. // TEMPLATE FUNCTION norm
  197. _TMPLT(_Ty) inline
  198. _Ty __cdecl norm(const _CMPLX(_Ty)& _X)
  199. {return (real(_X) * real(_X) + imag(_X) * imag(_X)); }
  200. // TEMPLATE FUNCTION polar
  201. _TMPLT(_Ty) inline
  202. _CMPLX(_Ty) __cdecl polar(const _Ty& _Rho, const _Ty& _Theta)
  203. {return (_CMPLX(_Ty)(_Rho * _CTR(_Ty)::cos(_Theta),
  204. _Rho * _CTR(_Ty)::sin(_Theta))); }
  205. _TMPLT(_Ty) inline
  206. _CMPLX(_Ty) __cdecl polar(const _Ty& _Rho)
  207. {return (polar(_Rho, (_Ty)0)); }
  208. // TEMPLATE FUNCTION pow
  209. _TMPLT(_Ty) inline
  210. _CMPLX(_Ty) __cdecl pow(const _CMPLX(_Ty)& _X,
  211. const _CMPLX(_Ty)& _Y)
  212. {if (imag(_Y) == 0)
  213. return (pow(_X, real(_Y)));
  214. else if (imag(_X) == 0)
  215. return (_CMPLX(_Ty)(pow(real(_X), _Y)));
  216. else
  217. return (exp(_Y * log(_X))); }
  218. _TMPLT(_Ty) inline
  219. _CMPLX(_Ty) __cdecl pow(const _CMPLX(_Ty)& _X, const _Ty& _Y)
  220. {if (imag(_X) == 0)
  221. return (_CMPLX(_Ty)(_CTR(_Ty)::pow(real(_X), _Y)));
  222. else
  223. return (exp(_Y * log(_X))); }
  224. _TMPLT(_Ty) inline
  225. _CMPLX(_Ty) __cdecl pow(const _CMPLX(_Ty)& _X, int _Y)
  226. {if (imag(_X) == 0)
  227. return (_CMPLX(_Ty)(_CTR(_Ty)::pow(real(_X), _Y)));
  228. else
  229. return (_Pow_int(_CMPLX(_Ty)(_X), _Y)); }
  230. _TMPLT(_Ty) inline
  231. _CMPLX(_Ty) __cdecl pow(const _Ty& _X, const _CMPLX(_Ty)& _Y)
  232. {if (imag(_Y) == 0)
  233. return (_CMPLX(_Ty)(_CTR(_Ty)::pow(_X, real(_Y))));
  234. else
  235. return (exp(_Y * _CTR(_Ty)::log(_X))); }
  236. // TEMPLATE FUNCTION sin
  237. _TMPLT(_Ty) inline
  238. _CMPLX(_Ty) __cdecl sin(const _CMPLX(_Ty)& _X)
  239. {return (_CMPLX(_Ty)(
  240. _CTR(_Ty)::_Cosh(imag(_X), _CTR(_Ty)::sin(real(_X))),
  241. _CTR(_Ty)::_Sinh(imag(_X), _CTR(_Ty)::cos(real(_X))))); }
  242. // TEMPLATE FUNCTION sinh
  243. _TMPLT(_Ty) inline
  244. _CMPLX(_Ty) __cdecl sinh(const _CMPLX(_Ty)& _X)
  245. {return (_CMPLX(_Ty)(
  246. _CTR(_Ty)::_Sinh(real(_X), _CTR(_Ty)::cos(imag(_X))),
  247. _CTR(_Ty)::_Cosh(real(_X), _CTR(_Ty)::sin(imag(_X))))); }
  248. // TEMPLATE FUNCTION sqrt
  249. _TMPLT(_Ty) inline
  250. _CMPLX(_Ty) __cdecl sqrt(const _CMPLX(_Ty)& _X)
  251. {int _Xexp;
  252. _Ty _Rho = _Fabs(_X, &_Xexp);
  253. if (_Xexp == 0)
  254. return (_CMPLX(_Ty)(_Rho, _Rho));
  255. else
  256. {_Ty _Remag = _CTR(_Ty)::ldexp(real(_X) < 0
  257. ? - real(_X) : real(_X), -_Xexp);
  258. _Rho = _CTR(_Ty)::ldexp(_CTR(_Ty)::sqrt(
  259. 2 * (_Remag + _Rho)), _Xexp / 2 - 1);
  260. if (0 <= real(_X))
  261. return (_CMPLX(_Ty)(_Rho, imag(_X) / (2 * _Rho)));
  262. else if (imag(_X) < 0)
  263. return (_CMPLX(_Ty)(-imag(_X) / (2 * _Rho), -_Rho));
  264. else
  265. return (_CMPLX(_Ty)(imag(_X) / (2 * _Rho),
  266. _Rho)); }}
  267. #ifdef _DLL
  268. #pragma warning(disable:4231) /* the extern before template is a non-standard extension */
  269. extern template _CRTIMP complex<float>& __cdecl operator+=(
  270. complex<float>&, const complex<float>&);
  271. extern template _CRTIMP complex<float>& __cdecl operator-=(
  272. complex<float>&, const complex<float>&);
  273. extern template _CRTIMP complex<float>& __cdecl operator*=(
  274. complex<float>&, const complex<float>&);
  275. extern template _CRTIMP complex<float>& __cdecl operator/=(
  276. complex<float>&, const complex<float>&);
  277. extern template _CRTIMP basic_istream<char, char_traits<char> >& __cdecl operator>>(
  278. basic_istream<char, char_traits<char> >&, complex<float>&);
  279. extern template _CRTIMP basic_ostream<char, char_traits<char> >& __cdecl operator<<(
  280. basic_ostream<char, char_traits<char> >&, const complex<float>&);
  281. extern template _CRTIMP basic_istream<wchar_t, char_traits<wchar_t> >& __cdecl operator>>(
  282. basic_istream<wchar_t, char_traits<wchar_t> >&, complex<float>&);
  283. extern template _CRTIMP basic_ostream<wchar_t, char_traits<wchar_t> >& __cdecl operator<<(
  284. basic_ostream<wchar_t, char_traits<wchar_t> >&, const complex<float>&);
  285. extern template _CRTIMP complex<double>& __cdecl operator+=(
  286. complex<double>&, const complex<double>&);
  287. extern template _CRTIMP complex<double>& __cdecl operator-=(
  288. complex<double>&, const complex<double>&);
  289. extern template _CRTIMP complex<double>& __cdecl operator*=(
  290. complex<double>&, const complex<double>&);
  291. extern template _CRTIMP complex<double>& __cdecl operator/=(
  292. complex<double>&, const complex<double>&);
  293. extern template _CRTIMP basic_istream<char, char_traits<char> >& __cdecl operator>>(
  294. basic_istream<char, char_traits<char> >&, complex<double>&);
  295. extern template _CRTIMP basic_ostream<char, char_traits<char> >& __cdecl operator<<(
  296. basic_ostream<char, char_traits<char> >&, const complex<double>&);
  297. extern template _CRTIMP basic_istream<wchar_t, char_traits<wchar_t> >& __cdecl operator>>(
  298. basic_istream<wchar_t, char_traits<wchar_t> >&, complex<double>&);
  299. extern template _CRTIMP basic_ostream<wchar_t, char_traits<wchar_t> >& __cdecl operator<<(
  300. basic_ostream<wchar_t, char_traits<wchar_t> >&, const complex<double>&);
  301. extern template _CRTIMP complex<long double>& __cdecl operator+=(
  302. complex<long double>&, const complex<long double>&);
  303. extern template _CRTIMP complex<long double>& __cdecl operator-=(
  304. complex<long double>&, const complex<long double>&);
  305. extern template _CRTIMP complex<long double>& __cdecl operator*=(
  306. complex<long double>&, const complex<long double>&);
  307. extern template _CRTIMP complex<long double>& __cdecl operator/=(
  308. complex<long double>&, const complex<long double>&);
  309. extern template _CRTIMP basic_istream<char, char_traits<char> >& __cdecl operator>>(
  310. basic_istream<char, char_traits<char> >&, complex<long double>&);
  311. extern template _CRTIMP basic_ostream<char, char_traits<char> >& __cdecl operator<<(
  312. basic_ostream<char, char_traits<char> >&, const complex<long double>&);
  313. extern template _CRTIMP basic_istream<wchar_t, char_traits<wchar_t> >& __cdecl operator>>(
  314. basic_istream<wchar_t, char_traits<wchar_t> >&, complex<long double>&);
  315. extern template _CRTIMP basic_ostream<wchar_t, char_traits<wchar_t> >& __cdecl operator<<(
  316. basic_ostream<wchar_t, char_traits<wchar_t> >&, const complex<long double>&);
  317. extern template _CRTIMP float __cdecl imag(const complex<float>&);
  318. extern template _CRTIMP float __cdecl real(const complex<float>&);
  319. extern template _CRTIMP float __cdecl _Fabs(const complex<float>&, int *);
  320. extern template _CRTIMP complex<float> __cdecl operator+(
  321. const complex<float>&, const complex<float>&);
  322. extern template _CRTIMP complex<float> __cdecl operator+(
  323. const complex<float>&, const float&);
  324. extern template _CRTIMP complex<float> __cdecl operator+(
  325. const float&, const complex<float>&);
  326. extern template _CRTIMP complex<float> __cdecl operator-(
  327. const complex<float>&, const complex<float>&);
  328. extern template _CRTIMP complex<float> __cdecl operator-(
  329. const complex<float>&, const float&);
  330. extern template _CRTIMP complex<float> __cdecl operator-(
  331. const float&, const complex<float>&);
  332. extern template _CRTIMP complex<float> __cdecl operator*(
  333. const complex<float>&, const complex<float>&);
  334. extern template _CRTIMP complex<float> __cdecl operator*(
  335. const complex<float>&, const float&);
  336. extern template _CRTIMP complex<float> __cdecl operator*(
  337. const float&, const complex<float>&);
  338. extern template _CRTIMP complex<float> __cdecl operator/(
  339. const complex<float>&, const complex<float>&);
  340. extern template _CRTIMP complex<float> __cdecl operator/(
  341. const complex<float>&, const float&);
  342. extern template _CRTIMP complex<float> __cdecl operator/(
  343. const float&, const complex<float>&);
  344. extern template _CRTIMP complex<float> __cdecl operator+(
  345. const complex<float>&);
  346. extern template _CRTIMP complex<float> __cdecl operator-(
  347. const complex<float>&);
  348. extern template _CRTIMP bool __cdecl operator==(
  349. const complex<float>&, const complex<float>&);
  350. extern template _CRTIMP bool __cdecl operator==(
  351. const complex<float>&, const float&);
  352. extern template _CRTIMP bool __cdecl operator==(
  353. const float&, const complex<float>&);
  354. extern template _CRTIMP bool __cdecl operator!=(
  355. const complex<float>&, const complex<float>&);
  356. extern template _CRTIMP bool __cdecl operator!=(
  357. const complex<float>&, const float&);
  358. extern template _CRTIMP bool __cdecl operator!=(
  359. const float&, const complex<float>&);
  360. extern template _CRTIMP float __cdecl abs(const complex<float>&);
  361. extern template _CRTIMP float __cdecl arg(const complex<float>&);
  362. extern template _CRTIMP complex<float> __cdecl conj(const complex<float>&);
  363. extern template _CRTIMP complex<float> __cdecl cos(const complex<float>&);
  364. extern template _CRTIMP complex<float> __cdecl cosh(const complex<float>&);
  365. extern template _CRTIMP complex<float> __cdecl exp(const complex<float>&);
  366. extern template _CRTIMP complex<float> __cdecl log(const complex<float>&);
  367. extern template _CRTIMP complex<float> __cdecl log10(const complex<float>&);
  368. extern template _CRTIMP float __cdecl norm(const complex<float>&);
  369. extern template _CRTIMP complex<float> __cdecl polar(const float&, const float&);
  370. extern template _CRTIMP complex<float> __cdecl polar(const float&);
  371. extern template _CRTIMP complex<float> __cdecl pow(
  372. const complex<float>&, const complex<float>&);
  373. extern template _CRTIMP complex<float> __cdecl pow(
  374. const complex<float>&, const float&);
  375. extern template _CRTIMP complex<float> __cdecl pow(
  376. const complex<float>&, int);
  377. extern template _CRTIMP complex<float> __cdecl pow(
  378. const float&, const complex<float>&);
  379. extern template _CRTIMP complex<float> __cdecl sin(const complex<float>&);
  380. extern template _CRTIMP complex<float> __cdecl sinh(const complex<float>&);
  381. extern template _CRTIMP complex<float> __cdecl sqrt(const complex<float>&);
  382. extern template _CRTIMP double __cdecl imag(const complex<double>&);
  383. extern template _CRTIMP double __cdecl real(const complex<double>&);
  384. extern template _CRTIMP double __cdecl _Fabs(const complex<double>&, int *);
  385. extern template _CRTIMP complex<double> __cdecl operator+(
  386. const complex<double>&, const complex<double>&);
  387. extern template _CRTIMP complex<double> __cdecl operator+(
  388. const complex<double>&, const double&);
  389. extern template _CRTIMP complex<double> __cdecl operator+(
  390. const double&, const complex<double>&);
  391. extern template _CRTIMP complex<double> __cdecl operator-(
  392. const complex<double>&, const complex<double>&);
  393. extern template _CRTIMP complex<double> __cdecl operator-(
  394. const complex<double>&, const double&);
  395. extern template _CRTIMP complex<double> __cdecl operator-(
  396. const double&, const complex<double>&);
  397. extern template _CRTIMP complex<double> __cdecl operator*(
  398. const complex<double>&, const complex<double>&);
  399. extern template _CRTIMP complex<double> __cdecl operator*(
  400. const complex<double>&, const double&);
  401. extern template _CRTIMP complex<double> __cdecl operator*(
  402. const double&, const complex<double>&);
  403. extern template _CRTIMP complex<double> __cdecl operator/(
  404. const complex<double>&, const complex<double>&);
  405. extern template _CRTIMP complex<double> __cdecl operator/(
  406. const complex<double>&, const double&);
  407. extern template _CRTIMP complex<double> __cdecl operator/(
  408. const double&, const complex<double>&);
  409. extern template _CRTIMP complex<double> __cdecl operator+(
  410. const complex<double>&);
  411. extern template _CRTIMP complex<double> __cdecl operator-(
  412. const complex<double>&);
  413. extern template _CRTIMP bool __cdecl operator==(
  414. const complex<double>&, const complex<double>&);
  415. extern template _CRTIMP bool __cdecl operator==(
  416. const complex<double>&, const double&);
  417. extern template _CRTIMP bool __cdecl operator==(
  418. const double&, const complex<double>&);
  419. extern template _CRTIMP bool __cdecl operator!=(
  420. const complex<double>&, const complex<double>&);
  421. extern template _CRTIMP bool __cdecl operator!=(
  422. const complex<double>&, const double&);
  423. extern template _CRTIMP bool __cdecl operator!=(
  424. const double&, const complex<double>&);
  425. extern template _CRTIMP double __cdecl abs(const complex<double>&);
  426. extern template _CRTIMP double __cdecl arg(const complex<double>&);
  427. extern template _CRTIMP complex<double> __cdecl conj(const complex<double>&);
  428. extern template _CRTIMP complex<double> __cdecl cos(const complex<double>&);
  429. extern template _CRTIMP complex<double> __cdecl cosh(const complex<double>&);
  430. extern template _CRTIMP complex<double> __cdecl exp(const complex<double>&);
  431. extern template _CRTIMP complex<double> __cdecl log(const complex<double>&);
  432. extern template _CRTIMP complex<double> __cdecl log10(const complex<double>&);
  433. extern template _CRTIMP double __cdecl norm(const complex<double>&);
  434. extern template _CRTIMP complex<double> __cdecl polar(const double&, const double&);
  435. extern template _CRTIMP complex<double> __cdecl polar(const double&);
  436. extern template _CRTIMP complex<double> __cdecl pow(
  437. const complex<double>&, const complex<double>&);
  438. extern template _CRTIMP complex<double> __cdecl pow(
  439. const complex<double>&, const double&);
  440. extern template _CRTIMP complex<double> __cdecl pow(
  441. const complex<double>&, int);
  442. extern template _CRTIMP complex<double> __cdecl pow(
  443. const double&, const complex<double>&);
  444. extern template _CRTIMP complex<double> __cdecl sin(const complex<double>&);
  445. extern template _CRTIMP complex<double> __cdecl sinh(const complex<double>&);
  446. extern template _CRTIMP complex<double> __cdecl sqrt(const complex<double>&);
  447. extern template _CRTIMP long double __cdecl imag(const complex<long double>&);
  448. extern template _CRTIMP long double __cdecl real(const complex<long double>&);
  449. extern template _CRTIMP long double __cdecl _Fabs(const complex<long double>&, int *);
  450. extern template _CRTIMP complex<long double> __cdecl operator+(
  451. const complex<long double>&, const complex<long double>&);
  452. extern template _CRTIMP complex<long double> __cdecl operator+(
  453. const complex<long double>&, const long double&);
  454. extern template _CRTIMP complex<long double> __cdecl operator+(
  455. const long double&, const complex<long double>&);
  456. extern template _CRTIMP complex<long double> __cdecl operator-(
  457. const complex<long double>&, const complex<long double>&);
  458. extern template _CRTIMP complex<long double> __cdecl operator-(
  459. const complex<long double>&, const long double&);
  460. extern template _CRTIMP complex<long double> __cdecl operator-(
  461. const long double&, const complex<long double>&);
  462. extern template _CRTIMP complex<long double> __cdecl operator*(
  463. const complex<long double>&, const complex<long double>&);
  464. extern template _CRTIMP complex<long double> __cdecl operator*(
  465. const complex<long double>&, const long double&);
  466. extern template _CRTIMP complex<long double> __cdecl operator*(
  467. const long double&, const complex<long double>&);
  468. extern template _CRTIMP complex<long double> __cdecl operator/(
  469. const complex<long double>&, const complex<long double>&);
  470. extern template _CRTIMP complex<long double> __cdecl operator/(
  471. const complex<long double>&, const long double&);
  472. extern template _CRTIMP complex<long double> __cdecl operator/(
  473. const long double&, const complex<long double>&);
  474. extern template _CRTIMP complex<long double> __cdecl operator+(
  475. const complex<long double>&);
  476. extern template _CRTIMP complex<long double> __cdecl operator-(
  477. const complex<long double>&);
  478. extern template _CRTIMP bool __cdecl operator==(
  479. const complex<long double>&, const complex<long double>&);
  480. extern template _CRTIMP bool __cdecl operator==(
  481. const complex<long double>&, const long double&);
  482. extern template _CRTIMP bool __cdecl operator==(
  483. const long double&, const complex<long double>&);
  484. extern template _CRTIMP bool __cdecl operator!=(
  485. const complex<long double>&, const complex<long double>&);
  486. extern template _CRTIMP bool __cdecl operator!=(
  487. const complex<long double>&, const long double&);
  488. extern template _CRTIMP bool __cdecl operator!=(
  489. const long double&, const complex<long double>&);
  490. extern template _CRTIMP long double __cdecl abs(const complex<long double>&);
  491. extern template _CRTIMP long double __cdecl arg(const complex<long double>&);
  492. extern template _CRTIMP complex<long double> __cdecl conj(const complex<long double>&);
  493. extern template _CRTIMP complex<long double> __cdecl cos(const complex<long double>&);
  494. extern template _CRTIMP complex<long double> __cdecl cosh(const complex<long double>&);
  495. extern template _CRTIMP complex<long double> __cdecl exp(const complex<long double>&);
  496. extern template _CRTIMP complex<long double> __cdecl log(const complex<long double>&);
  497. extern template _CRTIMP complex<long double> __cdecl log10(const complex<long double>&);
  498. extern template _CRTIMP long double __cdecl norm(const complex<long double>&);
  499. extern template _CRTIMP complex<long double> __cdecl polar(const long double&, const long double&);
  500. extern template _CRTIMP complex<long double> __cdecl polar(const long double&);
  501. extern template _CRTIMP complex<long double> __cdecl pow(
  502. const complex<long double>&, const complex<long double>&);
  503. extern template _CRTIMP complex<long double> __cdecl pow(
  504. const complex<long double>&, const long double&);
  505. extern template _CRTIMP complex<long double> __cdecl pow(
  506. const complex<long double>&, int);
  507. extern template _CRTIMP complex<long double> __cdecl pow(
  508. const long double&, const complex<long double>&);
  509. extern template _CRTIMP complex<long double> __cdecl sin(const complex<long double>&);
  510. extern template _CRTIMP complex<long double> __cdecl sinh(const complex<long double>&);
  511. extern template _CRTIMP complex<long double> __cdecl sqrt(const complex<long double>&);
  512. #pragma warning(default:4231) /* restore previous warning */
  513. #endif // _DLL
  514. /*
  515. * Copyright (c) 1996 by P.J. Plauger. ALL RIGHTS RESERVED.
  516. * Consult your license regarding permissions and restrictions.
  517. */