Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Complex Numbers

template <typename T> struct thrust::complex;
typedef see below thrust::complex::value_type;
__host__ __device__ thrust::complex::complex(const T & re);
__host__ __device__ thrust::complex::complex(const T & re,   const T & im);
template <typename U> __host__ __device__ thrust::complex::complex(const complex< U > & z);
__host__ __device__ thrust::complex::complex(const std::complex< T > & z);
template <typename U> __host__ __device__ thrust::complex::complex(const std::complex< U > & z);
__host__ __device__ complex & thrust::complex::operator=(const T & re);
complex & thrust::complex::operator=(const complex< T > & z) = default;
template <typename U> __host__ __device__ complex & thrust::complex::operator=(const complex< U > & z);
__host__ __device__ complex & thrust::complex::operator=(const std::complex< T > & z);
template <typename U> __host__ __device__ complex & thrust::complex::operator=(const std::complex< U > & z);
template <typename U> __host__ __device__ complex< T > & thrust::complex::operator+=(const complex< U > & z);
template <typename U> __host__ __device__ complex< T > & thrust::complex::operator-=(const complex< U > & z);
template <typename U> __host__ __device__ complex< T > & thrust::complex::operator*=(const complex< U > & z);
template <typename U> __host__ __device__ complex< T > & thrust::complex::operator/=(const complex< U > & z);
template <typename U> __host__ __device__ complex< T > & thrust::complex::operator+=(const U & z);
template <typename U> __host__ __device__ complex< T > & thrust::complex::operator-=(const U & z);
template <typename U> __host__ __device__ complex< T > & thrust::complex::operator*=(const U & z);
template <typename U> __host__ __device__ complex< T > & thrust::complex::operator/=(const U & z);
__host__ __device__ T thrust::complex::real() const;
__host__ __device__ T thrust::complex::imag() const;
__host__ __device__ T thrust::complex::real() const;
__host__ __device__ T thrust::complex::imag() const;
__host__ __device__ void thrust::complex::real(T re);
__host__ __device__ void thrust::complex::imag(T im);
__host__ __device__ void thrust::complex::real(T re);
__host__ __device__ void thrust::complex::imag(T im);
__host__ thrust::complex::complex< T >() const;
template <typename T> __host__ __device__ T thrust::abs(const complex< T > & z);
template <typename T> __host__ __device__ T thrust::arg(const complex< T > & z);
template <typename T> __host__ __device__ T thrust::norm(const complex< T > & z);
template <typename T> __host__ __device__ complex< T > thrust::conj(const complex< T > & z);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::polar(const T0 & m,   const T1 & theta = T1());
template <typename T> __host__ __device__ complex< T > thrust::proj(const T & z);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::operator+(const complex< T0 > & x,   const complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::operator+(const complex< T0 > & x,   const T1 & y);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::operator+(const T0 & x,   const complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::operator-(const complex< T0 > & x,   const complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::operator-(const complex< T0 > & x,   const T1 & y);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::operator-(const T0 & x,   const complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::operator*(const complex< T0 > & x,   const complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::operator*(const complex< T0 > & x,   const T1 & y);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::operator*(const T0 & x,   const complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::operator/(const complex< T0 > & x,   const complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::operator/(const complex< T0 > & x,   const T1 & y);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::operator/(const T0 & x,   const complex< T1 > & y);
template <typename T> __host__ __device__ complex< T > thrust::operator+(const complex< T > & y);
template <typename T> __host__ __device__ complex< T > thrust::operator-(const complex< T > & y);
template <typename T> __host__ __device__ complex< T > thrust::exp(const complex< T > & z);
template <typename T> __host__ __device__ complex< T > thrust::log(const complex< T > & z);
template <typename T> __host__ __device__ complex< T > thrust::log10(const complex< T > & z);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::pow(const complex< T0 > & x,   const complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::pow(const complex< T0 > & x,   const T1 & y);
template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > thrust::pow(const T0 & x,   const complex< T1 > & y);
template <typename T> __host__ __device__ complex< T > thrust::sqrt(const complex< T > & z);
template <typename T> __host__ __device__ complex< T > thrust::cos(const complex< T > & z);
template <typename T> __host__ __device__ complex< T > thrust::sin(const complex< T > & z);
template <typename T> __host__ __device__ complex< T > thrust::tan(const complex< T > & z);
template <typename T> __host__ __device__ complex< T > thrust::cosh(const complex< T > & z);
template <typename T> __host__ __device__ complex< T > thrust::sinh(const complex< T > & z);
template <typename T> __host__ __device__ complex< T > thrust::tanh(const complex< T > & z);
template <typename T> __host__ __device__ complex< T > thrust::acos(const complex< T > & z);
template <typename T> __host__ __device__ complex< T > thrust::asin(const complex< T > & z);
template <typename T> __host__ __device__ complex< T > thrust::atan(const complex< T > & z);
template <typename T> __host__ __device__ complex< T > thrust::acosh(const complex< T > & z);
template <typename T> __host__ __device__ complex< T > thrust::asinh(const complex< T > & z);
template <typename T> __host__ __device__ complex< T > thrust::atanh(const complex< T > & z);
template <typename T,   typename CharT,   typename Traits> std::basic_ostream< CharT, Traits > & thrust::operator<<(std::basic_ostream< CharT, Traits > & os,   const complex< T > & z);
template <typename T,   typename CharT,   typename Traits> __host__ std::basic_istream< CharT, Traits > & thrust::operator>>(std::basic_istream< CharT, Traits > & is,   complex< T > & z);
template <typename T0,   typename T1> __host__ __device__ bool thrust::operator==(const complex< T0 > & x,   const complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ bool thrust::operator==(const complex< T0 > & x,   const std::complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ bool thrust::operator==(const std::complex< T0 > & x,   const complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ bool thrust::operator==(const T0 & x,   const complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ bool thrust::operator==(const complex< T0 > & x,   const T1 & y);
template <typename T0,   typename T1> __host__ __device__ bool thrust::operator!=(const complex< T0 > & x,   const complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ bool thrust::operator!=(const complex< T0 > & x,   const std::complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ bool thrust::operator!=(const std::complex< T0 > & x,   const complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ bool thrust::operator!=(const T0 & x,   const complex< T1 > & y);
template <typename T0,   typename T1> __host__ __device__ bool thrust::operator!=(const complex< T0 > & x,   const T1 & y);

Member Classes

Struct thrust::complex

Types

Typedef thrust::complex::value_type

typedef Tvalue_type; value_type is the type of complex's real and imaginary parts.

Functions

Function thrust::complex::complex

__host__ __device__ complex(const T & re); Construct a complex number with an imaginary part of 0.

Function Parameters: re: The real part of the number.

Function thrust::complex::complex

__host__ __device__ complex(const T & re,   const T & im); Construct a complex number from its real and imaginary parts.

Function Parameters:

  • re The real part of the number.
  • im The imaginary part of the number.

Function thrust::complex::complex

complex() = default; Default construct a complex number.

Function thrust::complex::complex

complex(const complex< T > & z) = default; This copy constructor copies from a complex with a type that is convertible to this complex'svalue_type.

Function Parameters: z: The complex to copy from.

Function thrust::complex::complex

template <typename U> __host__ __device__ complex(const complex< U > & z); This converting copy constructor copies from a complex with a type that is convertible to this complex'svalue_type.

Template Parameters: U: is convertible to value_type.

Function Parameters: z: The complex to copy from.

Function thrust::complex::complex

__host__ __device__ complex(const std::complex< T > & z); This converting copy constructor copies from a std::complex with a type that is convertible to this complex'svalue_type.

Function Parameters: z: The complex to copy from.

Function thrust::complex::complex

template <typename U> __host__ __device__ complex(const std::complex< U > & z); This converting copy constructor copies from a std::complex with a type that is convertible to this complex'svalue_type.

Template Parameters: U: is convertible to value_type.

Function Parameters: z: The complex to copy from.

Function thrust::complex::operator=

__host__ __device__ complex & operator=(const T & re); Assign re to the real part of this complex and set the imaginary part to 0.

Function Parameters: re: The real part of the number.

Function thrust::complex::operator=

complex & operator=(const complex< T > & z) = default; Assign z.real() and z.imag() to the real and imaginary parts of this complex respectively.

Function Parameters: z: The complex to copy from.

Function thrust::complex::operator=

template <typename U> __host__ __device__ complex & operator=(const complex< U > & z); Assign z.real() and z.imag() to the real and imaginary parts of this complex respectively.

Template Parameters: U: is convertible to value_type.

Function Parameters: z: The complex to copy from.

Function thrust::complex::operator=

__host__ __device__ complex & operator=(const std::complex< T > & z); Assign z.real() and z.imag() to the real and imaginary parts of this complex respectively.

Function Parameters: z: The complex to copy from.

Function thrust::complex::operator=

template <typename U> __host__ __device__ complex & operator=(const std::complex< U > & z); Assign z.real() and z.imag() to the real and imaginary parts of this complex respectively.

Template Parameters: U: is convertible to value_type.

Function Parameters: z: The complex to copy from.

Function thrust::complex::operator+=

template <typename U> __host__ __device__ complex< T > & operator+=(const complex< U > & z); Adds a complex to this complex and assigns the result to this complex.

Template Parameters: U: is convertible to value_type.

Function Parameters: z: The complex to be added.

Function thrust::complex::operator-=

template <typename U> __host__ __device__ complex< T > & operator-=(const complex< U > & z); Subtracts a complex from this complex and assigns the result to this complex.

Template Parameters: U: is convertible to value_type.

Function Parameters: z: The complex to be subtracted.

Function thrust::complex::operator*=

template <typename U> __host__ __device__ complex< T > & operator*=(const complex< U > & z); Multiplies this complex by another complex and assigns the result to this complex.

Template Parameters: U: is convertible to value_type.

Function Parameters: z: The complex to be multiplied.

Function thrust::complex::operator/=

template <typename U> __host__ __device__ complex< T > & operator/=(const complex< U > & z); Divides this complex by another complex and assigns the result to this complex.

Template Parameters: U: is convertible to value_type.

Function Parameters: z: The complex to be divided.

Function thrust::complex::operator+=

template <typename U> __host__ __device__ complex< T > & operator+=(const U & z); Adds a scalar to this complex and assigns the result to this complex.

Template Parameters: U: is convertible to value_type.

Function Parameters: z: The complex to be added.

Function thrust::complex::operator-=

template <typename U> __host__ __device__ complex< T > & operator-=(const U & z); Subtracts a scalar from this complex and assigns the result to this complex.

Template Parameters: U: is convertible to value_type.

Function Parameters: z: The scalar to be subtracted.

Function thrust::complex::operator*=

template <typename U> __host__ __device__ complex< T > & operator*=(const U & z); Multiplies this complex by a scalar and assigns the result to this complex.

Template Parameters: U: is convertible to value_type.

Function Parameters: z: The scalar to be multiplied.

Function thrust::complex::operator/=

template <typename U> __host__ __device__ complex< T > & operator/=(const U & z); Divides this complex by a scalar and assigns the result to this complex.

Template Parameters: U: is convertible to value_type.

Function Parameters: z: The scalar to be divided.

Function thrust::complex::real

__host__ __device__ T real() const; Returns the real part of this complex.

Function thrust::complex::imag

__host__ __device__ T imag() const; Returns the imaginary part of this complex.

Function thrust::complex::real

__host__ __device__ T real() const; Returns the real part of this complex.

Function thrust::complex::imag

__host__ __device__ T imag() const; Returns the imaginary part of this complex.

Function thrust::complex::real

__host__ __device__ void real(T re); Sets the real part of this complex.

Function Parameters: re: The new real part of this complex.

Function thrust::complex::imag

__host__ __device__ void imag(T im); Sets the imaginary part of this complex.

Function Parameters: im: The new imaginary part of this complex.e

Function thrust::complex::real

__host__ __device__ void real(T re); Sets the real part of this complex.

Function Parameters: re: The new real part of this complex.

Function thrust::complex::imag

__host__ __device__ void imag(T im); Sets the imaginary part of this complex.

Function Parameters: im: The new imaginary part of this complex.

Function thrust::complex::complex< T >

__host__ operator std::complex< T >() const; Casts this complex to a std::complex of the same type.

Function thrust::abs

template <typename T> __host__ __device__ T abs(const complex< T > & z); Returns the magnitude (also known as absolute value) of a complex.

Function Parameters: z: The complex from which to calculate the absolute value.

Function thrust::arg

template <typename T> __host__ __device__ T arg(const complex< T > & z); Returns the phase angle (also known as argument) in radians of a complex.

Function Parameters: z: The complex from which to calculate the phase angle.

Function thrust::norm

template <typename T> __host__ __device__ T norm(const complex< T > & z); Returns the square of the magnitude of a complex.

Function Parameters: z: The complex from which to calculate the norm.

Function thrust::conj

template <typename T> __host__ __device__ complex< T > conj(const complex< T > & z); Returns the complex conjugate of a complex.

Function Parameters: z: The complex from which to calculate the complex conjugate.

Function thrust::polar

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > polar(const T0 & m,   const T1 & theta = T1()); Returns a complex with the specified magnitude and phase.

Function Parameters:

  • m The magnitude of the returned complex.
  • theta The phase of the returned complex in radians.

Function thrust::proj

template <typename T> __host__ __device__ complex< T > proj(const T & z); Returns the projection of a complex on the Riemann sphere. For all finite complex it returns the argument. For complexs with a non finite part returns (INFINITY,+/-0) where the sign of the zero matches the sign of the imaginary part of the argument.

Function Parameters: z: The complex argument.

Function thrust::operator+

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > operator+(const complex< T0 > & x,   const complex< T1 > & y); Adds two complex numbers.

The value types of the two complex types should be compatible and the type of the returned complex is the promoted type of the two arguments.

Function Parameters:

  • x The first complex.
  • y The second complex.

Function thrust::operator+

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > operator+(const complex< T0 > & x,   const T1 & y); Adds a scalar to a complex number.

The value type of the complex should be compatible with the scalar and the type of the returned complex is the promoted type of the two arguments.

Function Parameters:

  • x The complex.
  • y The scalar.

Function thrust::operator+

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > operator+(const T0 & x,   const complex< T1 > & y); Adds a complex number to a scalar.

The value type of the complex should be compatible with the scalar and the type of the returned complex is the promoted type of the two arguments.

Function Parameters:

  • x The scalar.
  • y The complex.

Function thrust::operator-

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > operator-(const complex< T0 > & x,   const complex< T1 > & y); Subtracts two complex numbers.

The value types of the two complex types should be compatible and the type of the returned complex is the promoted type of the two arguments.

Function Parameters:

  • x The first complex (minuend).
  • y The second complex (subtrahend).

Function thrust::operator-

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > operator-(const complex< T0 > & x,   const T1 & y); Subtracts a scalar from a complex number.

The value type of the complex should be compatible with the scalar and the type of the returned complex is the promoted type of the two arguments.

Function Parameters:

  • x The complex (minuend).
  • y The scalar (subtrahend).

Function thrust::operator-

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > operator-(const T0 & x,   const complex< T1 > & y); Subtracts a complex number from a scalar.

The value type of the complex should be compatible with the scalar and the type of the returned complex is the promoted type of the two arguments.

Function Parameters:

  • x The scalar (minuend).
  • y The complex (subtrahend).

Function thrust::operator*

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > operator*(const complex< T0 > & x,   const complex< T1 > & y); Multiplies two complex numbers.

The value types of the two complex types should be compatible and the type of the returned complex is the promoted type of the two arguments.

Function Parameters:

  • x The first complex.
  • y The second complex.

Function thrust::operator*

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > operator*(const complex< T0 > & x,   const T1 & y); Multiplies a complex number by a scalar.

Function Parameters:

  • x The complex.
  • y The scalar.

Function thrust::operator*

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > operator*(const T0 & x,   const complex< T1 > & y); Multiplies a scalar by a complex number.

The value type of the complex should be compatible with the scalar and the type of the returned complex is the promoted type of the two arguments.

Function Parameters:

  • x The scalar.
  • y The complex.

Function thrust::operator/

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > operator/(const complex< T0 > & x,   const complex< T1 > & y); Divides two complex numbers.

The value types of the two complex types should be compatible and the type of the returned complex is the promoted type of the two arguments.

Function Parameters:

  • x The numerator (dividend).
  • y The denomimator (divisor).

Function thrust::operator/

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > operator/(const complex< T0 > & x,   const T1 & y); Divides a complex number by a scalar.

The value type of the complex should be compatible with the scalar and the type of the returned complex is the promoted type of the two arguments.

Function Parameters:

  • x The complex numerator (dividend).
  • y The scalar denomimator (divisor).

Function thrust::operator/

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > operator/(const T0 & x,   const complex< T1 > & y); Divides a scalar by a complex number.

The value type of the complex should be compatible with the scalar and the type of the returned complex is the promoted type of the two arguments.

Function Parameters:

  • x The scalar numerator (dividend).
  • y The complex denomimator (divisor).

Function thrust::operator+

template <typename T> __host__ __device__ complex< T > operator+(const complex< T > & y); Unary plus, returns its complex argument.

Function Parameters: y: The complex argument.

Function thrust::operator-

template <typename T> __host__ __device__ complex< T > operator-(const complex< T > & y); Unary minus, returns the additive inverse (negation) of its complex argument.

Function Parameters: y: The complex argument.

Function thrust::exp

template <typename T> __host__ __device__ complex< T > exp(const complex< T > & z); Returns the complex exponential of a complex number.

Function Parameters: z: The complex argument.

Function thrust::log

template <typename T> __host__ __device__ complex< T > log(const complex< T > & z); Returns the complex natural logarithm of a complex number.

Function Parameters: z: The complex argument.

Function thrust::log10

template <typename T> __host__ __device__ complex< T > log10(const complex< T > & z); Returns the complex base 10 logarithm of a complex number.

Function Parameters: z: The complex argument.

Function thrust::pow

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > pow(const complex< T0 > & x,   const complex< T1 > & y); Returns a complex number raised to another.

The value types of the two complex types should be compatible and the type of the returned complex is the promoted type of the two arguments.

Function Parameters:

  • x The base.
  • y The exponent.

Function thrust::pow

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > pow(const complex< T0 > & x,   const T1 & y); Returns a complex number raised to a scalar.

The value type of the complex should be compatible with the scalar and the type of the returned complex is the promoted type of the two arguments.

Function Parameters:

  • x The base.
  • y The exponent.

Function thrust::pow

template <typename T0,   typename T1> __host__ __device__ complex< typename detail::promoted_numerical_type< T0, T1 >::type > pow(const T0 & x,   const complex< T1 > & y); Returns a scalar raised to a complex number.

The value type of the complex should be compatible with the scalar and the type of the returned complex is the promoted type of the two arguments.

Function Parameters:

  • x The base.
  • y The exponent.

Function thrust::sqrt

template <typename T> __host__ __device__ complex< T > sqrt(const complex< T > & z); Returns the complex square root of a complex number.

Function Parameters: z: The complex argument.

Function thrust::cos

template <typename T> __host__ __device__ complex< T > cos(const complex< T > & z); Returns the complex cosine of a complex number.

Function Parameters: z: The complex argument.

Function thrust::sin

template <typename T> __host__ __device__ complex< T > sin(const complex< T > & z); Returns the complex sine of a complex number.

Function Parameters: z: The complex argument.

Function thrust::tan

template <typename T> __host__ __device__ complex< T > tan(const complex< T > & z); Returns the complex tangent of a complex number.

Function Parameters: z: The complex argument.

Function thrust::cosh

template <typename T> __host__ __device__ complex< T > cosh(const complex< T > & z); Returns the complex hyperbolic cosine of a complex number.

Function Parameters: z: The complex argument.

Function thrust::sinh

template <typename T> __host__ __device__ complex< T > sinh(const complex< T > & z); Returns the complex hyperbolic sine of a complex number.

Function Parameters: z: The complex argument.

Function thrust::tanh

template <typename T> __host__ __device__ complex< T > tanh(const complex< T > & z); Returns the complex hyperbolic tangent of a complex number.

Function Parameters: z: The complex argument.

Function thrust::acos

template <typename T> __host__ __device__ complex< T > acos(const complex< T > & z); Returns the complex arc cosine of a complex number.

The range of the real part of the result is [0, Pi] and the range of the imaginary part is [-inf, +inf]

Function Parameters: z: The complex argument.

Function thrust::asin

template <typename T> __host__ __device__ complex< T > asin(const complex< T > & z); Returns the complex arc sine of a complex number.

The range of the real part of the result is [-Pi/2, Pi/2] and the range of the imaginary part is [-inf, +inf]

Function Parameters: z: The complex argument.

Function thrust::atan

template <typename T> __host__ __device__ complex< T > atan(const complex< T > & z); Returns the complex arc tangent of a complex number.

The range of the real part of the result is [-Pi/2, Pi/2] and the range of the imaginary part is [-inf, +inf]

Function Parameters: z: The complex argument.

Function thrust::acosh

template <typename T> __host__ __device__ complex< T > acosh(const complex< T > & z); Returns the complex inverse hyperbolic cosine of a complex number.

The range of the real part of the result is [0, +inf] and the range of the imaginary part is [-Pi, Pi]

Function Parameters: z: The complex argument.

Function thrust::asinh

template <typename T> __host__ __device__ complex< T > asinh(const complex< T > & z); Returns the complex inverse hyperbolic sine of a complex number.

The range of the real part of the result is [-inf, +inf] and the range of the imaginary part is [-Pi/2, Pi/2]

Function Parameters: z: The complex argument.

Function thrust::atanh

template <typename T> __host__ __device__ complex< T > atanh(const complex< T > & z); Returns the complex inverse hyperbolic tangent of a complex number.

The range of the real part of the result is [-inf, +inf] and the range of the imaginary part is [-Pi/2, Pi/2]

Function Parameters: z: The complex argument.

Function thrust::operator<<

template <typename T,   typename CharT,   typename Traits> std::basic_ostream< CharT, Traits > & operator<<(std::basic_ostream< CharT, Traits > & os,   const complex< T > & z); Writes to an output stream a complex number in the form (real, imaginary).

Function Parameters:

  • os The output stream.
  • z The complex number to output.

Function thrust::operator>>

template <typename T,   typename CharT,   typename Traits> __host__ std::basic_istream< CharT, Traits > & operator>>(std::basic_istream< CharT, Traits > & is,   complex< T > & z); Reads a complex number from an input stream.

The recognized formats are:

  • real
  • (real)
  • (real, imaginary) The values read must be convertible to the complex'svalue_type

Function Parameters:

  • is The input stream.
  • z The complex number to set.

Function thrust::operator==

template <typename T0,   typename T1> __host__ __device__ bool operator==(const complex< T0 > & x,   const complex< T1 > & y); Returns true if two complex numbers are equal and false otherwise.

Function Parameters:

  • x The first complex.
  • y The second complex.

Function thrust::operator==

template <typename T0,   typename T1> __host__ __device__ bool operator==(const complex< T0 > & x,   const std::complex< T1 > & y); Returns true if two complex numbers are equal and false otherwise.

Function Parameters:

  • x The first complex.
  • y The second complex.

Function thrust::operator==

template <typename T0,   typename T1> __host__ __device__ bool operator==(const std::complex< T0 > & x,   const complex< T1 > & y); Returns true if two complex numbers are equal and false otherwise.

Function Parameters:

  • x The first complex.
  • y The second complex.

Function thrust::operator==

template <typename T0,   typename T1> __host__ __device__ bool operator==(const T0 & x,   const complex< T1 > & y); Returns true if the imaginary part of the complex number is zero and the real part is equal to the scalar. Returns false otherwise.

Function Parameters:

  • x The scalar.
  • y The complex.

Function thrust::operator==

template <typename T0,   typename T1> __host__ __device__ bool operator==(const complex< T0 > & x,   const T1 & y); Returns true if the imaginary part of the complex number is zero and the real part is equal to the scalar. Returns false otherwise.

Function Parameters:

  • x The complex.
  • y The scalar.

Function thrust::operator!=

template <typename T0,   typename T1> __host__ __device__ bool operator!=(const complex< T0 > & x,   const complex< T1 > & y); Returns true if two complex numbers are different and false otherwise.

Function Parameters:

  • x The first complex.
  • y The second complex.

Function thrust::operator!=

template <typename T0,   typename T1> __host__ __device__ bool operator!=(const complex< T0 > & x,   const std::complex< T1 > & y); Returns true if two complex numbers are different and false otherwise.

Function Parameters:

  • x The first complex.
  • y The second complex.

Function thrust::operator!=

template <typename T0,   typename T1> __host__ __device__ bool operator!=(const std::complex< T0 > & x,   const complex< T1 > & y); Returns true if two complex numbers are different and false otherwise.

Function Parameters:

  • x The first complex.
  • y The second complex.

Function thrust::operator!=

template <typename T0,   typename T1> __host__ __device__ bool operator!=(const T0 & x,   const complex< T1 > & y); Returns true if the imaginary part of the complex number is not zero or the real part is different from the scalar. Returns false otherwise.

Function Parameters:

  • x The scalar.
  • y The complex.

Function thrust::operator!=

template <typename T0,   typename T1> __host__ __device__ bool operator!=(const complex< T0 > & x,   const T1 & y); Returns true if the imaginary part of the complex number is not zero or the real part is different from the scalar. Returns false otherwise.

Function Parameters:

  • x The complex.
  • y The scalar.