A complex number, similar to the C++ complex type. More...
Public Member Functions | |
complex (const complex &)=default | |
Copy construct. More... | |
complex & | operator= (const complex &)=default |
Copy assignment. More... | |
complex (complex &&)=default | |
Move construct. More... | |
complex & | operator= (complex &&)=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 |
Real part of complex number - STL naming. More... | |
constexpr scalar | imag () const |
Imaginary part of complex number - STL naming. More... | |
void | real (scalar val) |
Set real part of complex number - STL naming. More... | |
void | imag (scalar val) |
Set imaginary part of complex number - STL naming. More... | |
scalar | Re () const |
Real part of complex number. More... | |
scalar | Im () const |
Imaginary part of complex number. More... | |
scalar & | Re () |
Real part of complex number. More... | |
scalar & | Im () |
Imaginary part of complex number. More... | |
complex | conjugate () const |
Complex conjugate. 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 |
A complex number, similar to the C++ complex type.
|
inlineconstexprnoexcept |
Default construct, as zero-initialized.
Definition at line 31 of file complexI.H.
|
inlineconstexprnoexcept |
Construct zero-initialized from zero class.
Definition at line 38 of file complexI.H.
|
inlineexplicitconstexprnoexcept |
Construct from real component.
Definition at line 45 of file complexI.H.
|
inlineconstexprnoexcept |
Construct from real and imaginary parts.
Definition at line 52 of file complexI.H.
|
inline |
Implicit construct from std::complex.
Definition at line 59 of file complexI.H.
|
inline |
Implicit construct from std::complex.
Definition at line 66 of file complexI.H.
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
Set real part of complex number - STL naming.
Definition at line 75 of file complexI.H.
References Foam::constant::atomic::re.
|
inline |
Set imaginary part of complex number - STL naming.
Definition at line 81 of file complexI.H.
|
inline |
Real part of complex number.
Definition at line 87 of file complexI.H.
References Foam::constant::atomic::re.
|
inline |
Imaginary part of complex number.
Definition at line 93 of file complexI.H.
|
inline |
Real part of complex number.
Definition at line 99 of file complexI.H.
References Foam::constant::atomic::re.
|
inline |
Imaginary part of complex number.
Definition at line 105 of file complexI.H.
|
inline |
Complex conjugate.
Definition at line 111 of file complexI.H.
References Foam::roots::complex, and Foam::constant::atomic::re.
|
inline |
|
inline |
|
inline |
Assign scalar (imag = zero)
Definition at line 126 of file complexI.H.
References Foam::constant::atomic::re, and s.
|
inline |
Definition at line 133 of file complexI.H.
References Foam::constant::universal::c, and Foam::constant::atomic::re.
|
inline |
Definition at line 140 of file complexI.H.
References Foam::constant::atomic::re, and s.
|
inline |
Definition at line 146 of file complexI.H.
References Foam::constant::universal::c, and Foam::constant::atomic::re.
|
inline |
Definition at line 153 of file complexI.H.
References Foam::constant::atomic::re, and s.
|
inline |
Definition at line 159 of file complexI.H.
References Foam::constant::universal::c.
|
inline |
Definition at line 165 of file complexI.H.
References Foam::constant::atomic::re, and s.
|
inline |
Definition at line 172 of file complexI.H.
References Foam::constant::universal::c.
|
inline |
Definition at line 178 of file complexI.H.
References Foam::constant::atomic::re, and s.
Definition at line 185 of file complexI.H.
References Foam::constant::universal::c, Foam::equal(), and Foam::constant::atomic::re.
Definition at line 191 of file complexI.H.
References Foam::constant::universal::c, and Foam::operator==().
|
friend |
Definition at line 210 of file complexI.H.
|
friend |
Definition at line 216 of file complexI.H.
Definition at line 222 of file complexI.H.
sgn() https://en.wikipedia.org/wiki/Sign_function#Complex_signum
Definition at line 228 of file complexI.H.
|
friend |
csgn() https://en.wikipedia.org/wiki/Sign_function#Complex_signum
Definition at line 235 of file complexI.H.
Definition at line 241 of file complexI.H.
Definition at line 252 of file complexI.H.
Definition at line 263 of file complexI.H.
Definition at line 269 of file complexI.H.
Definition at line 285 of file complexI.H.
Definition at line 291 of file complexI.H.
Definition at line 301 of file complexI.H.
Definition at line 307 of file complexI.H.
Definition at line 313 of file complexI.H.
Definition at line 323 of file complexI.H.
Definition at line 329 of file complexI.H.
Definition at line 335 of file complexI.H.
Definition at line 345 of file complexI.H.
Definition at line 351 of file complexI.H.
Definition at line 357 of file complexI.H.
Definition at line 369 of file complexI.H.
Definition at line 375 of file complexI.H.