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