Loading [MathJax]/extensions/TeX/AMSsymbols.js
PSCF v1.2

Functions

template<>
Prdc::Cuda::cudaReal Pscf::real (Prdc::Cuda::cudaComplex const &a)
 Return the real part of a complex number.
 
template<>
Prdc::Cuda::cudaReal Pscf::imag (Prdc::Cuda::cudaComplex const &a)
 Return the imaginary part of a complex number.
 
template<>
Prdc::Cuda::cudaReal Pscf::abs (Prdc::Cuda::cudaComplex const &a)
 Return absolute magnitude of a complex number.
 
template<>
Prdc::Cuda::cudaReal Pscf::absSq (Prdc::Cuda::cudaComplex const &a)
 Return square of absolute magnitude of a complex number.
 
template<>
void Pscf::conj (Prdc::Cuda::cudaComplex &z, Prdc::Cuda::cudaComplex const &a)
 Compute complex conjugate, z = a^*.
 
template<>
void Pscf::conj (Prdc::Cuda::cudaComplex &a)
 In-place complex conjugation of a complex number, a = a^* .
 
template<>
void Pscf::assign (Prdc::Cuda::cudaComplex &z, Prdc::Cuda::cudaReal const &a, Prdc::Cuda::cudaReal const &b)
 Create a complex number from real and imaginary parts, z = a + ib.
 
template<>
void Pscf::assign (Prdc::Cuda::cudaComplex &z, Prdc::Cuda::cudaReal const &a)
 Assign a real input to a complex variable.
 
template<>
void Pscf::assign (Prdc::Cuda::cudaComplex &z, Prdc::Cuda::cudaComplex const &a)
 Assign a complex input to a complex variable.
 
template<>
void Pscf::assign (Prdc::Cuda::cudaComplex &z, std::complex< Prdc::Cuda::cudaReal > const &a)
 Assign a std::complex input to a complex variable.
 
template<>
void Pscf::assign (std::complex< Prdc::Cuda::cudaReal > &z, Prdc::Cuda::cudaComplex const &a)
 Assign a complex input to a std::complex variable.
 
template<>
void Pscf::add (Prdc::Cuda::cudaComplex &z, Prdc::Cuda::cudaComplex const &a, Prdc::Cuda::cudaComplex const &b)
 Addition of two complex numbers, z = a + b.
 
template<>
void Pscf::add (Prdc::Cuda::cudaComplex &z, Prdc::Cuda::cudaComplex const &a, Prdc::Cuda::cudaReal const &b)
 Addition of a complex and real number, z = a + b.
 
template<>
void Pscf::addEq (Prdc::Cuda::cudaComplex &a, Prdc::Cuda::cudaComplex const &b)
 In place addition of complex numbers, a += b.
 
template<>
void Pscf::addEq (Prdc::Cuda::cudaComplex &a, Prdc::Cuda::cudaReal const &b)
 In place addition of a complex and real number, a += b.
 
template<>
void Pscf::sub (Prdc::Cuda::cudaComplex &z, Prdc::Cuda::cudaComplex const &a, Prdc::Cuda::cudaComplex const &b)
 Subtraction of two complex numbers, z = a - b.
 
template<>
void Pscf::sub (Prdc::Cuda::cudaComplex &z, Prdc::Cuda::cudaComplex const &a, Prdc::Cuda::cudaReal const &b)
 Subtraction of a real number from a complex number, z = a - b.
 
template<>
void Pscf::subEq (Prdc::Cuda::cudaComplex &a, Prdc::Cuda::cudaComplex const &b)
 In place subtraction of two complex numbers, a -= b.
 
template<>
void Pscf::subEq (Prdc::Cuda::cudaComplex &a, Prdc::Cuda::cudaReal const &b)
 In place subtraction of real number from a complex number, a -= b.
 
template<>
Prdc::Cuda::cudaReal Pscf::absSqDiff (Prdc::Cuda::cudaComplex const &a, Prdc::Cuda::cudaComplex const &b)
 Return square of the absolute magnitude of a complex difference.
 
template<>
void Pscf::mul (Prdc::Cuda::cudaComplex &z, Prdc::Cuda::cudaComplex const &a, Prdc::Cuda::cudaComplex const &b)
 Multiplication of two complex numbers, z = a * b.
 
template<>
void Pscf::mul (Prdc::Cuda::cudaComplex &z, Prdc::Cuda::cudaComplex const &a, Prdc::Cuda::cudaReal const &b)
 Multiplication of complex and real numbers, z = a * b.
 
template<>
void Pscf::mulEq (Prdc::Cuda::cudaComplex &a, Prdc::Cuda::cudaComplex const &b)
 In place multiplication of two complex number, a *= b.
 
template<>
void Pscf::mulEq (Prdc::Cuda::cudaComplex &a, Prdc::Cuda::cudaReal const &b)
 In place multiplication of a complex and real number, a *= b.
 
template<>
void Pscf::square (Prdc::Cuda::cudaComplex &z, Prdc::Cuda::cudaComplex const &a)
 Compute complex square of a complex number, z = a * a.
 
template<>
void Pscf::div (Prdc::Cuda::cudaComplex &z, Prdc::Cuda::cudaComplex const &a, Prdc::Cuda::cudaComplex const &b)
 Division of two complex numbers, z = a / b .
 
template<>
void Pscf::div (Prdc::Cuda::cudaComplex &z, Prdc::Cuda::cudaComplex const &a, Prdc::Cuda::cudaReal const &b)
 Division of a complex number by a real number, z = a / b .
 
template<>
void Pscf::divEq (Prdc::Cuda::cudaComplex &a, Prdc::Cuda::cudaComplex const &b)
 In place division of two complex number, a /= b.
 
template<>
void Pscf::divEq (Prdc::Cuda::cudaComplex &a, Prdc::Cuda::cudaReal const &b)
 In place division of a complex number by a real number, a /= b.
 

Detailed Description

Typdedefs and functions for complex arithmetic using the complex type used in Cuda GPU code that interfaces with cufft.

Function Documentation

◆ real()

template<>
Prdc::Cuda::cudaReal Pscf::real ( Prdc::Cuda::cudaComplex const & a)
inline

Return the real part of a complex number.

Parameters
acomplex argument (input)

Definition at line 33 of file prdc/cuda/complex.h.

◆ imag()

template<>
Prdc::Cuda::cudaReal Pscf::imag ( Prdc::Cuda::cudaComplex const & a)
inline

Return the imaginary part of a complex number.

Parameters
acomplex argument (input)

Definition at line 44 of file prdc/cuda/complex.h.

◆ abs()

template<>
Prdc::Cuda::cudaReal Pscf::abs ( Prdc::Cuda::cudaComplex const & a)
inline

Return absolute magnitude of a complex number.

Parameters
acomplex argument (in)

Definition at line 57 of file prdc/cuda/complex.h.

◆ absSq()

template<>
Prdc::Cuda::cudaReal Pscf::absSq ( Prdc::Cuda::cudaComplex const & a)
inline

Return square of absolute magnitude of a complex number.

Parameters
acomplex argument (in)

Definition at line 68 of file prdc/cuda/complex.h.

◆ conj() [1/2]

template<>
void Pscf::conj ( Prdc::Cuda::cudaComplex & z,
Prdc::Cuda::cudaComplex const & a )
inline

Compute complex conjugate, z = a^*.

Parameters
zcomplex conjugate of argument (out)
acomplex argument (in)

Definition at line 82 of file prdc/cuda/complex.h.

◆ conj() [2/2]

template<>
void Pscf::conj ( Prdc::Cuda::cudaComplex & a)
inline

In-place complex conjugation of a complex number, a = a^* .

Parameters
aargument (in) and complex conjugate (out)

Definition at line 96 of file prdc/cuda/complex.h.

◆ assign() [1/5]

template<>
void Pscf::assign ( Prdc::Cuda::cudaComplex & z,
Prdc::Cuda::cudaReal const & a,
Prdc::Cuda::cudaReal const & b )
inline

Create a complex number from real and imaginary parts, z = a + ib.

Parameters
zcomplex (out)
areal part (in)
bimaginary part (in)

Definition at line 114 of file prdc/cuda/complex.h.

◆ assign() [2/5]

template<>
void Pscf::assign ( Prdc::Cuda::cudaComplex & z,
Prdc::Cuda::cudaReal const & a )
inline

Assign a real input to a complex variable.

Parameters
zcomplex (out)
areal (in)

Definition at line 130 of file prdc/cuda/complex.h.

◆ assign() [3/5]

template<>
void Pscf::assign ( Prdc::Cuda::cudaComplex & z,
Prdc::Cuda::cudaComplex const & a )
inline

Assign a complex input to a complex variable.

Parameters
zcomplex (out)
acomplex (in)

Definition at line 145 of file prdc/cuda/complex.h.

◆ assign() [4/5]

template<>
void Pscf::assign ( Prdc::Cuda::cudaComplex & z,
std::complex< Prdc::Cuda::cudaReal > const & a )
inline

Assign a std::complex input to a complex variable.

Parameters
zcomplex (out)
astd::complex (in)

Definition at line 160 of file prdc/cuda/complex.h.

◆ assign() [5/5]

template<>
void Pscf::assign ( std::complex< Prdc::Cuda::cudaReal > & z,
Prdc::Cuda::cudaComplex const & a )
inline

Assign a complex input to a std::complex variable.

Parameters
zstd::complex (out)
acomplex (in)

Definition at line 176 of file prdc/cuda/complex.h.

◆ add() [1/2]

template<>
void Pscf::add ( Prdc::Cuda::cudaComplex & z,
Prdc::Cuda::cudaComplex const & a,
Prdc::Cuda::cudaComplex const & b )
inline

Addition of two complex numbers, z = a + b.

Parameters
zcomplex sum (out)
acomplex summand (in)
bcomplex summand (in)

Definition at line 192 of file prdc/cuda/complex.h.

◆ add() [2/2]

template<>
void Pscf::add ( Prdc::Cuda::cudaComplex & z,
Prdc::Cuda::cudaComplex const & a,
Prdc::Cuda::cudaReal const & b )
inline

Addition of a complex and real number, z = a + b.

Parameters
zcomplex sum (out)
acomplex summand (in)
breal summand (in)

Definition at line 209 of file prdc/cuda/complex.h.

◆ addEq() [1/2]

template<>
void Pscf::addEq ( Prdc::Cuda::cudaComplex & a,
Prdc::Cuda::cudaComplex const & b )
inline

In place addition of complex numbers, a += b.

Parameters
acomplex summand (in) and sum (out)
bcomplex summand (in)

Definition at line 225 of file prdc/cuda/complex.h.

◆ addEq() [2/2]

template<>
void Pscf::addEq ( Prdc::Cuda::cudaComplex & a,
Prdc::Cuda::cudaReal const & b )
inline

In place addition of a complex and real number, a += b.

Parameters
acomplex summand (in) and sum (out)
breal summand (in)

Definition at line 240 of file prdc/cuda/complex.h.

◆ sub() [1/2]

template<>
void Pscf::sub ( Prdc::Cuda::cudaComplex & z,
Prdc::Cuda::cudaComplex const & a,
Prdc::Cuda::cudaComplex const & b )
inline

Subtraction of two complex numbers, z = a - b.

Parameters
zcomplex difference (out)
acomplex 1st argument (in)
bcomplex 2nd argument (in)

Definition at line 257 of file prdc/cuda/complex.h.

◆ sub() [2/2]

template<>
void Pscf::sub ( Prdc::Cuda::cudaComplex & z,
Prdc::Cuda::cudaComplex const & a,
Prdc::Cuda::cudaReal const & b )
inline

Subtraction of a real number from a complex number, z = a - b.

Parameters
zcomplex difference (out)
acomplex 1st argument (in)
breal 2nd argument (in)

Definition at line 274 of file prdc/cuda/complex.h.

◆ subEq() [1/2]

template<>
void Pscf::subEq ( Prdc::Cuda::cudaComplex & a,
Prdc::Cuda::cudaComplex const & b )
inline

In place subtraction of two complex numbers, a -= b.

Parameters
acomplex argument (in) and difference (out)
bcomplex argument (in)

Definition at line 290 of file prdc/cuda/complex.h.

◆ subEq() [2/2]

template<>
void Pscf::subEq ( Prdc::Cuda::cudaComplex & a,
Prdc::Cuda::cudaReal const & b )
inline

In place subtraction of real number from a complex number, a -= b.

Parameters
acomplex argument (in) and difference (out)
breal argument (in)

Definition at line 305 of file prdc/cuda/complex.h.

◆ absSqDiff()

template<>
Prdc::Cuda::cudaReal Pscf::absSqDiff ( Prdc::Cuda::cudaComplex const & a,
Prdc::Cuda::cudaComplex const & b )
inline

Return square of the absolute magnitude of a complex difference.

This function returns |a-b|^2 for complex a and b.

Parameters
acomplex 1st argument (in)
bcomplex 2nd argument (in)

Definition at line 321 of file prdc/cuda/complex.h.

References Pscf::absSq(), and Pscf::sub().

◆ mul() [1/2]

template<>
void Pscf::mul ( Prdc::Cuda::cudaComplex & z,
Prdc::Cuda::cudaComplex const & a,
Prdc::Cuda::cudaComplex const & b )
inline

Multiplication of two complex numbers, z = a * b.

Parameters
zcomplex product (out)
acomplex factor (in)
bcomplex factor (in)

Definition at line 341 of file prdc/cuda/complex.h.

◆ mul() [2/2]

template<>
void Pscf::mul ( Prdc::Cuda::cudaComplex & z,
Prdc::Cuda::cudaComplex const & a,
Prdc::Cuda::cudaReal const & b )
inline

Multiplication of complex and real numbers, z = a * b.

Parameters
zcomplex product (out)
acomplex factor (in)
breal factor (in)

Definition at line 358 of file prdc/cuda/complex.h.

◆ mulEq() [1/2]

template<>
void Pscf::mulEq ( Prdc::Cuda::cudaComplex & a,
Prdc::Cuda::cudaComplex const & b )
inline

In place multiplication of two complex number, a *= b.

Parameters
acomplex factor (in) and product (out)
bcomplex factor (in)

Definition at line 374 of file prdc/cuda/complex.h.

◆ mulEq() [2/2]

template<>
void Pscf::mulEq ( Prdc::Cuda::cudaComplex & a,
Prdc::Cuda::cudaReal const & b )
inline

In place multiplication of a complex and real number, a *= b.

Parameters
acomplex factor (in) and product (out)
breal factor (in)

Definition at line 391 of file prdc/cuda/complex.h.

◆ square()

template<>
void Pscf::square ( Prdc::Cuda::cudaComplex & z,
Prdc::Cuda::cudaComplex const & a )
inline

Compute complex square of a complex number, z = a * a.

Parameters
zcomplex product (out)
acomplex factor (in)

Definition at line 406 of file prdc/cuda/complex.h.

◆ div() [1/2]

template<>
void Pscf::div ( Prdc::Cuda::cudaComplex & z,
Prdc::Cuda::cudaComplex const & a,
Prdc::Cuda::cudaComplex const & b )
inline

Division of two complex numbers, z = a / b .

Parameters
zcomplex ratio (out)
acomplex numerator (in)
bcomplex denominator (in)

Definition at line 424 of file prdc/cuda/complex.h.

◆ div() [2/2]

template<>
void Pscf::div ( Prdc::Cuda::cudaComplex & z,
Prdc::Cuda::cudaComplex const & a,
Prdc::Cuda::cudaReal const & b )
inline

Division of a complex number by a real number, z = a / b .

Parameters
zcomplex ratio (out)
acomplex numerator (in)
breal denominator (in)

Definition at line 442 of file prdc/cuda/complex.h.

◆ divEq() [1/2]

template<>
void Pscf::divEq ( Prdc::Cuda::cudaComplex & a,
Prdc::Cuda::cudaComplex const & b )
inline

In place division of two complex number, a /= b.

Parameters
acomplex numerator (in) and ratio (out)
bcomplex denominator (in)

Definition at line 458 of file prdc/cuda/complex.h.

◆ divEq() [2/2]

template<>
void Pscf::divEq ( Prdc::Cuda::cudaComplex & a,
Prdc::Cuda::cudaReal const & b )
inline

In place division of a complex number by a real number, a /= b.

Parameters
acomplex numerator (in) and ratio (out)
breal denominator (in)

Definition at line 475 of file prdc/cuda/complex.h.