![]() |
Home | Libraries | People | FAQ | More |
#include <boost/tr1/complex.hpp>
or
#include <complex>
The following function templates have additional overloads: arg
, norm
,
conj
, polar
,
imag
, and real
.
The additional overloads are sufficient to ensure:
long
double
, then the overload behaves
as if the argument had been cast to std::complex<long double>
.
double
or is an integer type, then the overload behaves as if the argument had
been cast to std::complex<double>
.
float
,
then the overload behaves as if the argument had been cast to std::complex<float>
.
The function template pow
has additional overloads sufficient to ensure, for a call with at least one
argument of type std::complex<T>
:
complex<long double>
or type long double
,
then the overload behaves as if both arguments were cast to std::complex<long double>
complex<double>
, double
,
or an integer type, then the overload behaves as if both arguments were
cast to std::complex<double>
complex<float>
or float
,
then the overload behaves as if both arguments were cast to std::complex<float>
In the following synopsis, Real
is a floating point type, Arithmetic
is an integer or floating point type, and PROMOTE(X1 ...
XN)
is the largest floating point type in the list X1 to XN, after any non-floating
point types in the list have been replaced by the type double
.
template <class Arithmetic> PROMOTE(Arithmetic) arg(const Arithmetic& t); template <class Arithmetic> PROMOTE(Arithmetic) norm(const Arithmetic& t); template <class Arithmetic> complex<PROMOTE(Arithmetic)> conj(const Arithmetic& t); template <class Arithmetic1, class Arithmetic2> complex<PROMOTE(Arithmetic1,Arithmetic2)> polar(const Arithmetic1& rho, const Arithmetic2& theta = 0); template <class Arithmetic> PROMOTE(Arithmetic) imag(const Arithmetic& ); template <class Arithmetic> PROMOTE(Arithmetic) real(const Arithmetic& t); template<class Real1, class Real2> complex<PROMOTE(Real1, Real2)> pow(const complex<Real1>& x, const complex<Real2>& y); template<class Real, class Arithmetic> complex<PROMOTE(Real, Arithmetic)> pow (const complex<Real>& x, const Arithmetic& y); template<class Arithmetic, class Real> complex<PROMOTE(Real, Arithmetic)> pow (const Arithmetic& x, const complex<Real>& y);
Configuration: Boost.Config should (automatically) define the macro BOOST_HAS_TR1_COMPLEX_OVERLOADS if your standard library implements the additional overloads for the existing complex arithmetic functions.
Standard Conformity: No known problems.