A complex number, similar to the C++ complex type. More...
Public Member Functions | |
complex (const complex &) noexcept=default | |
Copy construct. More... | |
complex & | operator= (const complex &) noexcept=default |
Copy assignment. More... | |
complex (complex &&) noexcept=default | |
Move construct. More... | |
complex & | operator= (complex &&) noexcept=default |
Move assignment. More... | |
constexpr | complex () noexcept |
Default construct, as zero-initialized. More... | |
constexpr | complex (const Foam::zero) noexcept |
Construct zero-initialized from zero class. More... | |
constexpr | complex (const scalar r) noexcept |
Construct from real component. More... | |
constexpr | complex (const scalar r, const scalar i) noexcept |
Construct from real and imaginary parts. More... | |
complex (const std::complex< float > &c) | |
Implicit construct from std::complex. More... | |
complex (const std::complex< double > &c) | |
Implicit construct from std::complex. More... | |
complex (Istream &is) | |
Construct from Istream. More... | |
constexpr scalar | real () const noexcept |
Real part of complex number - STL naming. More... | |
constexpr scalar | imag () const noexcept |
Imaginary part of complex number - STL naming. More... | |
void | real (scalar val) noexcept |
Set real part of complex number - STL naming. More... | |
void | imag (scalar val) noexcept |
Set imaginary part of complex number - STL naming. More... | |
complex | conjugate () const |
Complex conjugate. More... | |
scalar | magnitude () const |
The magnitude (L2-norm) of complex. Called magnitude() instead mag(), which looks too much like imag() More... | |
scalar | magSqr () const |
The L2-norm squared of complex. More... | |
scalar | cmptSum () const noexcept |
The sum of real/imag components. More... | |
operator std::complex< scalar > () const | |
Implicit conversion to std::complex. More... | |
void | operator= (const Foam::zero) |
Assign zero. More... | |
void | operator= (const scalar s) |
Assign scalar (imag = zero) More... | |
void | operator+= (const complex &c) |
void | operator+= (const scalar s) |
void | operator-= (const complex &c) |
void | operator-= (const scalar s) |
void | operator*= (const complex &c) |
void | operator*= (const scalar s) |
void | operator/= (const complex &c) |
void | operator/= (const scalar s) |
bool | operator== (const complex &c) const |
bool | operator!= (const complex &c) const |
scalar | Re () const noexcept |
Get real part of complex number. Same as real() More... | |
scalar | Im () const noexcept |
Get imaginary part of complex number. Same as imag() More... | |
scalar & | Re () noexcept |
Non-const access to real part. Prefer real() setter method. More... | |
scalar & | Im () noexcept |
Non-const access to imaginary part. Prefer imag() setter method. More... | |
Friends | |
complex | operator- (const complex &c) |
complex | operator+ (const complex &c1, const complex &c2) |
complex | operator+ (const complex &c, const scalar s) |
complex | operator+ (const scalar s, const complex &c) |
complex | operator- (const complex &c1, const complex &c2) |
complex | operator- (const complex &c, const scalar s) |
complex | operator- (const scalar s, const complex &c) |
complex | operator* (const complex &c1, const complex &c2) |
complex | operator* (const complex &c, const scalar s) |
complex | operator* (const scalar s, const complex &c) |
complex | operator/ (const complex &c1, const complex &c2) |
complex | operator/ (const complex &c, const scalar s) |
complex | operator/ (const scalar s, const complex &c) |
A complex number, similar to the C++ complex type.
|
inlinenoexcept |
Default construct, as zero-initialized.
Definition at line 24 of file complexI.H.
|
inlinenoexcept |
Construct zero-initialized from zero class.
Definition at line 31 of file complexI.H.
|
inlineexplicitnoexcept |
Construct from real component.
Definition at line 38 of file complexI.H.
|
inlinenoexcept |
Construct from real and imaginary parts.
Definition at line 45 of file complexI.H.
|
inline |
Implicit construct from std::complex.
Definition at line 52 of file complexI.H.
|
inline |
Implicit construct from std::complex.
Definition at line 59 of file complexI.H.
|
inlinenoexcept |
Real part of complex number - STL naming.
Definition at line 150 of file complex.H.
Referenced by Foam::lerp().
|
inlinenoexcept |
Imaginary part of complex number - STL naming.
Definition at line 155 of file complex.H.
Referenced by Foam::lerp().
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Complex conjugate.
Definition at line 68 of file complexI.H.
References Foam::roots::complex, and Foam::constant::atomic::re.
|
inline |
The magnitude (L2-norm) of complex. Called magnitude() instead mag(), which looks too much like imag()
Definition at line 74 of file complexI.H.
References Foam::hypot(), and Foam::constant::atomic::re.
|
inline |
The L2-norm squared of complex.
Definition at line 80 of file complexI.H.
References Foam::constant::atomic::re.
|
inlinenoexcept |
The sum of real/imag components.
Definition at line 86 of file complexI.H.
References Foam::constant::atomic::re.
|
inline |
|
inline |
|
inline |
Assign scalar (imag = zero)
Definition at line 101 of file complexI.H.
References Foam::constant::atomic::re, and s.
|
inline |
Definition at line 108 of file complexI.H.
References Foam::constant::universal::c, and Foam::constant::atomic::re.
|
inline |
Definition at line 115 of file complexI.H.
References Foam::constant::atomic::re, and s.
|
inline |
Definition at line 121 of file complexI.H.
References Foam::constant::universal::c, and Foam::constant::atomic::re.
|
inline |
Definition at line 128 of file complexI.H.
References Foam::constant::atomic::re, and s.
|
inline |
Definition at line 134 of file complexI.H.
References Foam::constant::universal::c.
|
inline |
Definition at line 140 of file complexI.H.
References Foam::constant::atomic::re, and s.
|
inline |
Definition at line 147 of file complexI.H.
References Foam::constant::universal::c.
|
inline |
Definition at line 153 of file complexI.H.
References Foam::constant::atomic::re, and s.
|
inline |
Definition at line 160 of file complexI.H.
References Foam::constant::universal::c, Foam::equal(), and Foam::constant::atomic::re.
|
inline |
Definition at line 166 of file complexI.H.
References Foam::constant::universal::c, and Foam::operator==().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 279 of file complexI.H.
Definition at line 285 of file complexI.H.
Definition at line 295 of file complexI.H.
Definition at line 301 of file complexI.H.
Definition at line 307 of file complexI.H.
Definition at line 317 of file complexI.H.
Definition at line 323 of file complexI.H.
Definition at line 329 of file complexI.H.
Definition at line 339 of file complexI.H.
Definition at line 345 of file complexI.H.
Definition at line 351 of file complexI.H.
Definition at line 363 of file complexI.H.
Definition at line 369 of file complexI.H.