-
Notifications
You must be signed in to change notification settings - Fork 0
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;
.
template<class Scalar>
class complex {
public:
typedef Scalar value_type;
private:
value_type re,im;
public:
KOKKOS_INLINE_FUNCTION complex();
KOKKOS_INLINE_FUNCTION complex(const complex& src);
KOKKOS_INLINE_FUNCTION complex(const volatile complex& src);
template<class T>
KOKKOS_INLINE_FUNCTION complex(const T& re);
template <class T1, class T2>
KOKKOS_INLINE_FUNCTION complex(const T1& re, const T2& im)
template<class T>
complex(const std::complex<T>& src);
template<class T>
KOKKOS_INLINE_FUNCTION complex<Scalar>& operator= (const complex<T>& src);
template<class T>
KOKKOS_INLINE_FUNCTION complex<Scalar>& operator= (const volatile complex<T>& src);
template<class T>
KOKKOS_INLINE_FUNCTION complex<Scalar>& operator= (const complex<T>& src) volatile;
template<class T>
KOKKOS_INLINE_FUNCTION complex<Scalar>& operator= (const volatile complex<T>& src) volatile;
template<class T>
KOKKOS_INLINE_FUNCTION complex<Scalar>& operator= (const T& re);
template<class T>
KOKKOS_INLINE_FUNCTION complex<Scalar>& operator= (const T& re) volatile;
template<class T>
KOKKOS_INLINE_FUNCTION complex<Scalar>& operator= (const std::complex<T>& src);
template<class T>
operator std::complex<Scalar>() const;
KOKKOS_INLINE_FUNCTION RealType& imag();
KOKKOS_INLINE_FUNCTION RealType& real();
KOKKOS_INLINE_FUNCTION const RealType imag() const;
KOKKOS_INLINE_FUNCTION const RealType real() const;
KOKKOS_INLINE_FUNCTION volatile RealType& imag() volatile;
KOKKOS_INLINE_FUNCTION volatile RealType& real() volatile;
KOKKOS_INLINE_FUNCTION const RealType imag() const volatile;
KOKKOS_INLINE_FUNCTION const RealType real() const volatile;
KOKKOS_INLINE_FUNCTION void imag(RealType v);
KOKKOS_INLINE_FUNCTION void real(RealType v);
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator += (const complex<T>& src);
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator += (const volatile complex<T>& src) volatile;
template<class T>
complex& operator += (const std::complex<T>& src);
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator += (const T& real);
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator += (const volatile T& real) real;
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator -= (const complex<T>& src);
template<class T>
complex& operator -= (const std::complex<T>& src);
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator -= (const T& real);
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator *= (const complex<T>& src);
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator *= (const volatile complex<T>& src) volatile;
template<class T>
complex& operator *= (const std::complex<T>& src);
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator *= (const T& real);
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator *= (const volatile T& real) real;
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator /= (const complex<T>& src);
template<class T>
complex& operator /= (const std::complex<T>& src);
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator /= (const T& real);
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator == (const complex<T>& src);
template<class T>
complex& operator == (const std::complex<T>& src);
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator == (const T& real);
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator != (const complex<T>& src);
template<class T>
complex& operator != (const std::complex<T>& src);
template<class T>
KOKKOS_INLINE_FUNCTION complex& operator != (const T& real);
};
-
value_type
: The scalar type of the real and the imaginary component.
-
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()
. -
KOKKOS_INLINE_FUNCTION complex(const volatile 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()
.
-
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 volatile complex<T>& src);
Sets
re = src.real()
andim = src.imag()
. -
template<class T> KOKKOS_INLINE_FUNCTION complex<Scalar>& operator= (const complex<T>& src) volatile;
Sets
re = src.real()
andim = src.imag()
. -
template<class T> KOKKOS_INLINE_FUNCTION complex<Scalar>& operator= (const volatile complex<T>& src) volatile;
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 T& re) volatile;
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)
.
-
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 volatile RealType& imag() volatile;
Return
im
. -
KOKKOS_INLINE_FUNCTION volatile RealType& real() volatile;
Return
re
. -
KOKKOS_INLINE_FUNCTION const RealType imag() const volatile;
Return
im
. -
KOKKOS_INLINE_FUNCTION const RealType real() const volatile;
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> KOKKOS_INLINE_FUNCTION complex& operator += (const volatile complex<T>& src) volatile;
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 volatile T& real) 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> KOKKOS_INLINE_FUNCTION complex& operator *= (const volatile complex<T>& src) volatile;
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 volatile T& real) 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()
. -
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()
.
Home:
- Introduction
- Machine Model
- Programming Model
- Compiling
- Initialization
- View
- Parallel Dispatch
- Hierarchical Parallelism
- Custom Reductions
- Atomic Operations
- Subviews
- Interoperability
- Kokkos and Virtual Functions
- Initialization and Finalization
- View
- Data Parallelism
- Execution Policies
- Spaces
- Task Parallelism
- Utilities
- STL Compatibility
- Numerics
- Detection Idiom