tr1/complex
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _GLIBCXX_TR1_COMPLEX
00030 #define _GLIBCXX_TR1_COMPLEX 1
00031
00032 #pragma GCC system_header
00033
00034 #if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
00035 # error TR1 header cannot be included from C++0x header
00036 #endif
00037
00038 #include <complex>
00039
00040 #if defined(_GLIBCXX_INCLUDE_AS_TR1)
00041 # include <tr1_impl/complex>
00042 #else
00043 # define _GLIBCXX_INCLUDE_AS_TR1
00044 # define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
00045 # define _GLIBCXX_END_NAMESPACE_TR1 }
00046 # define _GLIBCXX_TR1 tr1::
00047 # include <tr1_impl/complex>
00048 # undef _GLIBCXX_TR1
00049 # undef _GLIBCXX_END_NAMESPACE_TR1
00050 # undef _GLIBCXX_BEGIN_NAMESPACE_TR1
00051 # undef _GLIBCXX_INCLUDE_AS_TR1
00052 #endif
00053
00054 namespace std
00055 {
00056 namespace tr1
00057 {
00058 using std::arg;
00059 using std::conj;
00060 using std::imag;
00061 using std::norm;
00062 using std::polar;
00063
00064 template<typename _Tp, typename _Up>
00065 inline std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type>
00066 polar(const _Tp& __rho, const _Up& __theta)
00067 {
00068 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00069 return std::polar(__type(__rho), __type(__theta));
00070 }
00071
00072 using std::real;
00073
00074 template<typename _Tp>
00075 inline std::complex<_Tp>
00076 pow(const std::complex<_Tp>& __x, const _Tp& __y)
00077 { return std::pow(__x, __y); }
00078
00079 template<typename _Tp>
00080 inline std::complex<_Tp>
00081 pow(const _Tp& __x, const std::complex<_Tp>& __y)
00082 { return std::pow(__x, __y); }
00083
00084 template<typename _Tp>
00085 inline std::complex<_Tp>
00086 pow(const std::complex<_Tp>& __x, const std::complex<_Tp>& __y)
00087 { return std::pow(__x, __y); }
00088 }
00089 }
00090
00091 #endif // _GLIBCXX_TR1_COMPLEX