A complex number, similar to the C++ complex type. More...
Public Member Functions | |
constexpr | complex () noexcept |
Construct null as zero-initialized. More... | |
complex (const complex &)=default | |
Default copy constructor. 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) | |
Construct from std::complex. More... | |
complex (const std::complex< double > &c) | |
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 | |
Conversion to std::complex. More... | |
void | operator= (const complex &c) |
Copy assignment. 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 |
Construct null 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 |
Construct from std::complex.
Definition at line 59 of file complexI.H.
|
inline |
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, and Foam::val.
|
inline |
Set imaginary part of complex number - STL naming.
Definition at line 81 of file complexI.H.
References Foam::val.
|
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 |
Copy assignment.
Definition at line 119 of file complexI.H.
References Foam::constant::universal::c, and Foam::constant::atomic::re.
|
inline |
|
inline |
Assign scalar (imag = zero)
Definition at line 133 of file complexI.H.
References Foam::constant::atomic::re, and s.
|
inline |
Definition at line 140 of file complexI.H.
References Foam::constant::universal::c, and Foam::constant::atomic::re.
|
inline |
Definition at line 147 of file complexI.H.
References Foam::constant::atomic::re, and s.
|
inline |
Definition at line 153 of file complexI.H.
References Foam::constant::universal::c, and Foam::constant::atomic::re.
|
inline |
Definition at line 160 of file complexI.H.
References Foam::constant::atomic::re, and s.
|
inline |
Definition at line 166 of file complexI.H.
References Foam::constant::universal::c.
|
inline |
Definition at line 172 of file complexI.H.
References Foam::constant::atomic::re, and s.
|
inline |
Definition at line 179 of file complexI.H.
References Foam::constant::universal::c.
|
inline |
Definition at line 185 of file complexI.H.
References Foam::constant::atomic::re, and s.
Definition at line 192 of file complexI.H.
References Foam::constant::universal::c, Foam::equal(), and Foam::constant::atomic::re.
Definition at line 198 of file complexI.H.
References Foam::constant::universal::c, and Foam::operator==().
|
friend |
Definition at line 217 of file complexI.H.
|
friend |
Definition at line 223 of file complexI.H.
Definition at line 229 of file complexI.H.
sgn() https://en.wikipedia.org/wiki/Sign_function#Complex_signum
Definition at line 235 of file complexI.H.
|
friend |
csgn() https://en.wikipedia.org/wiki/Sign_function#Complex_signum
Definition at line 242 of file complexI.H.
Definition at line 248 of file complexI.H.
Definition at line 259 of file complexI.H.
Definition at line 270 of file complexI.H.
Definition at line 276 of file complexI.H.
Definition at line 292 of file complexI.H.
Definition at line 298 of file complexI.H.
Definition at line 308 of file complexI.H.
Definition at line 314 of file complexI.H.
Definition at line 320 of file complexI.H.
Definition at line 330 of file complexI.H.
Definition at line 336 of file complexI.H.
Definition at line 342 of file complexI.H.
Definition at line 352 of file complexI.H.
Definition at line 358 of file complexI.H.
Definition at line 364 of file complexI.H.
Definition at line 376 of file complexI.H.
Definition at line 382 of file complexI.H.