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
00060 template<typename _Tp>
00061 inline std::complex<_Tp>
00062 conj(const std::complex<_Tp>& __z)
00063 { return std::conj(__z); }
00064
00065 template<typename _Tp>
00066 inline std::complex<typename __gnu_cxx::__promote<_Tp>::__type>
00067 conj(_Tp __x)
00068 { return __x; }
00069
00070 using std::imag;
00071 using std::norm;
00072 using std::polar;
00073
00074 template<typename _Tp, typename _Up>
00075 inline std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type>
00076 polar(const _Tp& __rho, const _Up& __theta)
00077 {
00078 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
00079 return std::polar(__type(__rho), __type(__theta));
00080 }
00081
00082 using std::real;
00083
00084 template<typename _Tp>
00085 inline std::complex<_Tp>
00086 pow(const std::complex<_Tp>& __x, const _Tp& __y)
00087 { return std::pow(__x, __y); }
00088
00089 template<typename _Tp>
00090 inline std::complex<_Tp>
00091 pow(const _Tp& __x, const std::complex<_Tp>& __y)
00092 { return std::pow(__x, __y); }
00093
00094 template<typename _Tp>
00095 inline std::complex<_Tp>
00096 pow(const std::complex<_Tp>& __x, const std::complex<_Tp>& __y)
00097 { return std::pow(__x, __y); }
00098 }
00099 }
00100
00101 #endif // _GLIBCXX_TR1_COMPLEX