``Kokkos::complex`` =================== .. role:: cpp(code) :language: cpp Header File: ```` Usage ----- .. code-block:: cpp Kokkos::complex a,b; a.imag() = 5.0; a.real() = 1.0 b = a; a += b; Description ----------- .. cpp:class:: template complex | .. rubric:: Public Typedefs .. cpp:type:: value_type The scalar type of the real and the imaginary component. .. rubric:: Private Members .. cpp:member:: value_type im .. cpp:member:: value_type re Private data members representing the real and the imaginary parts. .. rubric:: Constructors .. cpp:function:: KOKKOS_INLINE_FUNCTION complex(); Default constructor. Initializes the ``re`` and ``im`` with ``value_type()``. .. cpp:function:: KOKKOS_INLINE_FUNCTION complex(const complex& src); Copy constructor. Sets ``re = src.real()`` and ``im = src.imag()``. .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex(const T& real); Constructor from a real number. Sets ``re = real`` and ``im = value_type()``. .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex(const T1& real, const T2& imag) Constructor from real numbers. Sets ``re = real`` and ``im = imag``. .. cpp:function:: template complex(const std::complex& src); Copy constructor. Sets ``re = src.real()`` and ``im = src.imag()``. .. rubric:: Assignment and conversion .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex& operator= (const complex& src); Sets ``re = src.real()`` and ``im = src.imag()``. .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex& operator= (const T& re); Sets ``re = src.real()`` and ``im = value_type()``. .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex& operator= (const std::complex& src); Sets ``re = src.real()`` and ``im = src.imag()``. .. cpp:function:: operator std::complex() const; Returns ``std::complex(re,im)``. .. rubric:: Functions .. cpp:function:: KOKKOS_INLINE_FUNCTION RealType& imag(); Return ``im``. .. cpp:function:: KOKKOS_INLINE_FUNCTION RealType& real(); Return ``re``. .. cpp:function:: KOKKOS_INLINE_FUNCTION const RealType imag() const; Return ``im``. .. cpp:function:: KOKKOS_INLINE_FUNCTION const RealType real() const; Return ``re``. .. cpp:function:: KOKKOS_INLINE_FUNCTION void imag(RealType v); Sets ``im = v``. .. cpp:function:: KOKKOS_INLINE_FUNCTION void real(RealType v); Sets ``re = v``. .. cpp:function:: templateKOKKOS_INLINE_FUNCTION complex& operator += (const complex& src); Executes ``re += src.real(); im += src.imag(); return *this;`` .. cpp:function:: template complex& operator += (const std::complex& src); Executes ``re += src.real(); im += src.imag(); return *this;`` .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex& operator += (const T& real); Executes ``re += real; return *this;`` .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex& operator -= (const complex& src); Executes ``re -= src.real(); im -= src.imag(); return *this;`` .. cpp:function:: template complex& operator -= (const std::complex& src); Executes ``re -= src.real(); im -= src.imag(); return *this;`` .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex& operator -= (const T& real); Executes ``re -= real; return *this;`` .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex& operator *= (const complex& src); Multiplies the current complex number with the complex number ``src``. .. cpp:function:: template complex& operator *= (const std::complex& src); Multiplies the current complex number with the complex number ``src``. .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex& operator *= (const T& real); Executes ``re *= real; im *= real; return *this;`` .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex& operator /= (const complex& src); Divides the current complex number with the complex number ``src``. .. cpp:function:: template complex& operator /= (const std::complex& src); Divides the current complex number with the complex number ``src``. .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex& operator /= (const T& real); Executes ``re /= real; im /= real; return *this;`` .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex& operator == (const complex& src); Returns ``re == src.real() && im == src.imag()``. .. cpp:function:: template complex& operator == (const std::complex& src); Returns ``re == src.real() && im == src.imag()``. .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex& operator == (const T& real); Returns ``re == src.real() && im == value_type()``. .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex& operator != (const complex& src); Returns ``re != src.real() || im != src.imag()``. .. cpp:function:: template complex& operator != (const std::complex& src); Returns ``re != src.real() || im != src.imag()``. .. cpp:function:: template KOKKOS_INLINE_FUNCTION complex& operator != (const T& real); Returns ``re != src.real() || im != value_type()``.