PSCF v1.5.0

Complex arithmetic functions using the complex type fftw_complex defined by the FFTW fast Fourier transform library. More...

Functions

double Pscf::real (fftw_complex const &a)
 Return the real part of an fftw_complex number.
double Pscf::imag (fftw_complex const &a)
 Return the imaginary part of an fftw_complex number.
double Pscf::abs (fftw_complex const &a)
 Return absolute magnitude of an fftw_complex number.
double Pscf::absSq (fftw_complex const &a)
 Return square of absolute magnitude of an fftw_complex number.
void Pscf::conj (fftw_complex &z, fftw_complex const &a)
 Complex conjugate of an fftw_complex, z = a^*.
void Pscf::conj (fftw_complex &a)
 In-place complex conjugation of an fftw_complex number, a = a^* .
void Pscf::assign (fftw_complex &z, double const &a, double const &b)
 Create an fftw_complex from real and imaginary parts, z = a + ib.
void Pscf::assign (fftw_complex &z, double const &a)
 Assign a real input to an fftw_complex variable.
void Pscf::assign (fftw_complex &z, fftw_complex const &a)
 Assign an fftw_complex input to an fftw_complex variable.
void Pscf::assign (fftw_complex &z, std::complex< double > const &a)
 Assign a std::complex input to an fftw_complex variable.
void Pscf::assign (std::complex< double > &z, fftw_complex const &a)
 Assign an fftw_complex input to a std::complex variable.
void Pscf::add (fftw_complex &z, fftw_complex const &a, fftw_complex const &b)
 Addition of fftw_complex numbers, z = a + b.
void Pscf::add (fftw_complex &z, fftw_complex const &a, double const &b)
 Addition of a complex and real number, z = a + b.
void Pscf::addEq (fftw_complex &a, fftw_complex const &b)
 In-place addition of fftw_complex numbers, a += b.
void Pscf::addEq (fftw_complex &a, double const &b)
 In-place addition of a complex and real number, a += b.
void Pscf::sub (fftw_complex &z, fftw_complex const &a, fftw_complex const &b)
 Subtraction of fftw_complex numbers, z = a - b.
void Pscf::sub (fftw_complex &z, fftw_complex const &a, double const &b)
 Subtraction of a real number from an fftw_complex number, z = a - b.
void Pscf::subEq (fftw_complex &a, fftw_complex const &b)
 In-place subtraction of fftw_complex numbers, a -= b.
void Pscf::subEq (fftw_complex &a, double const &b)
 In-place subtraction of real from an fftw_complex number, a -= b.
double Pscf::absSqDiff (fftw_complex const &a, fftw_complex const &b)
 Return square of the absolute magnitude of a complex difference.
void Pscf::mul (fftw_complex &z, fftw_complex const &a, fftw_complex const &b)
 Multiplication of fftw_complex numbers, z = a * b.
void Pscf::mul (fftw_complex &z, fftw_complex const &a, double const &b)
 Multiplication of an fftw_complex and real number, z = a * b.
void Pscf::mulEq (fftw_complex &a, fftw_complex const &b)
 In-place multiplication of two complex number, a *= b.
void Pscf::mulEq (fftw_complex &a, double const &b)
 In-place multiplication of a complex and real number, a *= b.
void Pscf::square (fftw_complex &z, fftw_complex const &a)
 Complex square of an fftw_complex number, z = a * a.
void Pscf::div (fftw_complex &z, fftw_complex const &a, fftw_complex const &b)
 Division of fftw_complex numbers, z = a / b .
void Pscf::div (fftw_complex &z, fftw_complex const &a, double const &b)
 Division of an fftw_complex number by a real number, z = a / b .
void Pscf::divEq (fftw_complex &a, fftw_complex const &b)
 In-place division of fftw_complex numbers, a /= b.
void Pscf::divEq (fftw_complex &a, double const &b)
 In-place division of an fftw_complex number by a real number, a /= b.
void Pscf::inverse (fftw_complex &z, fftw_complex const &a)
 Inversion of an fftw_complex number, z = 1 / a .
void Pscf::assignExp (fftw_complex &z, fftw_complex const &a)
 Exponentation of a ffts_complex variable, z = exp(a).
void Pscf::assignLog (fftw_complex &z, fftw_complex const &a)
 Logarithm of an fftw_complex variable, z = log(a).
std::istream & Pscf::operator>> (std::istream &is, fftw_complex &z)
 Stream extraction operator for fftw_complex.
std::ostream & Pscf::operator<< (std::ostream &os, fftw_complex const &z)
 Stream insertion operator for fftw_complex.

Detailed Description

Complex arithmetic functions using the complex type fftw_complex defined by the FFTW fast Fourier transform library.

Function Documentation

◆ real()

double Pscf::real ( fftw_complex const & a)
inline

Return the real part of an fftw_complex number.

Parameters
acomplex argument (in)

Definition at line 38 of file cpp/complex.h.

References real().

Referenced by readBasisData(), real(), real(), writeCFieldData(), and writeCFieldsData().

◆ imag()

double Pscf::imag ( fftw_complex const & a)
inline

Return the imaginary part of an fftw_complex number.

Parameters
acomplex argument (in)

Definition at line 49 of file cpp/complex.h.

References imag().

Referenced by imag(), imag(), readBasisData(), writeCFieldData(), and writeCFieldsData().

◆ abs()

double Pscf::abs ( fftw_complex const & a)
inline

Return absolute magnitude of an fftw_complex number.

Parameters
acomplex argument (in)

Definition at line 62 of file cpp/complex.h.

References abs().

Referenced by abs(), and abs().

◆ absSq()

double Pscf::absSq ( fftw_complex const & a)
inline

Return square of absolute magnitude of an fftw_complex number.

Parameters
acomplex argument (in)

Definition at line 73 of file cpp/complex.h.

References absSq().

Referenced by absSq(), absSq(), absSqDiff(), and absSqDiff().

◆ conj() [1/2]

void Pscf::conj ( fftw_complex & z,
fftw_complex const & a )
inline

Complex conjugate of an fftw_complex, z = a^*.

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

Definition at line 87 of file cpp/complex.h.

References conj().

Referenced by conj(), conj(), conj(), and conj().

◆ conj() [2/2]

void Pscf::conj ( fftw_complex & a)
inline

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

Parameters
aargument and output (in/out)

Definition at line 101 of file cpp/complex.h.

References conj().

◆ assign() [1/5]

void Pscf::assign ( fftw_complex & z,
double const & a,
double const & b )
inline

Create an fftw_complex from real and imaginary parts, z = a + ib.

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

Definition at line 119 of file cpp/complex.h.

References assign().

Referenced by assign(), assign(), assign(), assign(), assign(), assign(), assign(), assign(), assign(), assign(), assign(), assign(), assign(), assign(), assign(), readCFieldData(), readCFieldsData(), readRGridData(), readRGridData(), Pscf::Species< WT >::setMu(), Pscf::Species< WT >::setPhi(), Pscf::Species< WT >::setQ(), Pscf::Species< WT >::Species(), and Pscf::Species< RealT >::Species().

◆ assign() [2/5]

void Pscf::assign ( fftw_complex & z,
double const & a )
inline

Assign a real input to an fftw_complex variable.

Parameters
zcomplex (out)
areal (in)

Definition at line 134 of file cpp/complex.h.

References assign().

◆ assign() [3/5]

void Pscf::assign ( fftw_complex & z,
fftw_complex const & a )
inline

Assign an fftw_complex input to an fftw_complex variable.

Parameters
zcomplex (out)
acomplex (in)

Definition at line 149 of file cpp/complex.h.

References assign().

◆ assign() [4/5]

void Pscf::assign ( fftw_complex & z,
std::complex< double > const & a )
inline

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

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

Definition at line 164 of file cpp/complex.h.

References assign().

◆ assign() [5/5]

void Pscf::assign ( std::complex< double > & z,
fftw_complex const & a )
inline

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

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

Definition at line 179 of file cpp/complex.h.

References assign().

◆ add() [1/2]

void Pscf::add ( fftw_complex & z,
fftw_complex const & a,
fftw_complex const & b )
inline

Addition of fftw_complex numbers, z = a + b.

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

Definition at line 194 of file cpp/complex.h.

References add().

Referenced by add(), add(), add(), add(), add(), add(), add(), and add().

◆ add() [2/2]

void Pscf::add ( fftw_complex & z,
fftw_complex const & a,
double 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 210 of file cpp/complex.h.

References add().

◆ addEq() [1/2]

void Pscf::addEq ( fftw_complex & a,
fftw_complex const & b )
inline

In-place addition of fftw_complex numbers, a += b.

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

Definition at line 225 of file cpp/complex.h.

References addEq().

Referenced by addEq(), addEq(), addEq(), addEq(), addEq(), addEq(), addEq(), and addEq().

◆ addEq() [2/2]

void Pscf::addEq ( fftw_complex & a,
double 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 cpp/complex.h.

References addEq().

◆ sub() [1/2]

void Pscf::sub ( fftw_complex & z,
fftw_complex const & a,
fftw_complex const & b )
inline

Subtraction of fftw_complex numbers, z = a - b.

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

Definition at line 257 of file cpp/complex.h.

References sub().

Referenced by absSqDiff(), absSqDiff(), sub(), sub(), sub(), sub(), sub(), sub(), sub(), and sub().

◆ sub() [2/2]

void Pscf::sub ( fftw_complex & z,
fftw_complex const & a,
double const & b )
inline

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

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

Definition at line 273 of file cpp/complex.h.

References sub().

◆ subEq() [1/2]

void Pscf::subEq ( fftw_complex & a,
fftw_complex const & b )
inline

In-place subtraction of fftw_complex numbers, a -= b.

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

Definition at line 288 of file cpp/complex.h.

References subEq().

Referenced by subEq(), subEq(), subEq(), subEq(), subEq(), subEq(), subEq(), and subEq().

◆ subEq() [2/2]

void Pscf::subEq ( fftw_complex & a,
double const & b )
inline

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

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

Definition at line 303 of file cpp/complex.h.

References subEq().

◆ absSqDiff()

double Pscf::absSqDiff ( fftw_complex const & a,
fftw_complex 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 319 of file cpp/complex.h.

References absSq(), absSqDiff(), and sub().

Referenced by absSqDiff(), and absSqDiff().

◆ mul() [1/2]

void Pscf::mul ( fftw_complex & z,
fftw_complex const & a,
fftw_complex const & b )
inline

Multiplication of fftw_complex numbers, z = a * b.

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

Definition at line 338 of file cpp/complex.h.

References mul().

Referenced by mul(), mul(), mul(), mul(), mul(), mul(), mul(), mul(), and Pscf::Species< WT >::setQ().

◆ mul() [2/2]

void Pscf::mul ( fftw_complex & z,
fftw_complex const & a,
double const & b )
inline

Multiplication of an fftw_complex and real number, z = a * b.

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

Definition at line 354 of file cpp/complex.h.

References mul().

◆ mulEq() [1/2]

void Pscf::mulEq ( fftw_complex & a,
fftw_complex 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 369 of file cpp/complex.h.

References mulEq().

Referenced by mulEq(), mulEq(), mulEq(), mulEq(), mulEq(), and mulEq().

◆ mulEq() [2/2]

void Pscf::mulEq ( fftw_complex & a,
double 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 386 of file cpp/complex.h.

References mulEq().

◆ square()

void Pscf::square ( fftw_complex & z,
fftw_complex const & a )
inline

Complex square of an fftw_complex number, z = a * a.

Parameters
zcomplex product (out)
acomplex factor (in)

Definition at line 401 of file cpp/complex.h.

References square().

Referenced by square(), square(), and square().

◆ div() [1/2]

void Pscf::div ( fftw_complex & z,
fftw_complex const & a,
fftw_complex const & b )
inline

Division of fftw_complex numbers, z = a / b .

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

Definition at line 419 of file cpp/complex.h.

References div().

Referenced by div(), div(), div(), div(), div(), div(), div(), div(), and Pscf::Species< WT >::setQ().

◆ div() [2/2]

void Pscf::div ( fftw_complex & z,
fftw_complex const & a,
double const & b )
inline

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

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

Definition at line 436 of file cpp/complex.h.

References div().

◆ divEq() [1/2]

void Pscf::divEq ( fftw_complex & a,
fftw_complex const & b )
inline

In-place division of fftw_complex numbers, a /= b.

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

Definition at line 451 of file cpp/complex.h.

References divEq().

Referenced by divEq(), divEq(), divEq(), divEq(), divEq(), divEq(), divEq(), and divEq().

◆ divEq() [2/2]

void Pscf::divEq ( fftw_complex & a,
double const & b )
inline

In-place division of an fftw_complex number by a real number, a /= b.

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

Definition at line 468 of file cpp/complex.h.

References divEq().

◆ inverse()

void Pscf::inverse ( fftw_complex & z,
fftw_complex const & a )
inline

Inversion of an fftw_complex number, z = 1 / a .

Parameters
zinverse (out)
aargument (in)

Definition at line 485 of file cpp/complex.h.

References inverse().

Referenced by inverse(), inverse(), inverse(), and inverse().

◆ assignExp()

void Pscf::assignExp ( fftw_complex & z,
fftw_complex const & a )

Exponentation of a ffts_complex variable, z = exp(a).

Parameters
zexponent (out)
aargument (in)

Definition at line 17 of file complex.cpp.

References assignExp().

Referenced by assignExp(), assignExp(), assignExp(), assignExp(), and Pscf::Species< WT >::setQ().

◆ assignLog()

void Pscf::assignLog ( fftw_complex & z,
fftw_complex const & a )

Logarithm of an fftw_complex variable, z = log(a).

Parameters
zlogarithm (out)
aargument (in)

Definition at line 28 of file complex.cpp.

References assignLog().

Referenced by assignLog(), assignLog(), assignLog(), assignLog(), and Pscf::Species< WT >::setQ().

◆ operator>>()

std::istream & Pscf::operator>> ( std::istream & is,
fftw_complex & z )

Stream extraction operator for fftw_complex.

Parameters
isinput stream
zcomplex number

Definition at line 39 of file complex.cpp.

◆ operator<<()

std::ostream & Pscf::operator<< ( std::ostream & os,
fftw_complex const & z )

Stream insertion operator for fftw_complex.

Parameters
osoutput stream
zcomplex number
Returns
modified output stream

Definition at line 48 of file complex.cpp.