A complex number, similar to the C++ complex type. More...
#include <complex.H>

Public Member Functions | |
| complex (const complex &) noexcept=default | |
| Copy construct. | |
| complex & | operator= (const complex &) noexcept=default |
| Copy assignment. | |
| complex (complex &&) noexcept=default | |
| Move construct. | |
| complex & | operator= (complex &&) noexcept=default |
| Move assignment. | |
| constexpr | complex () noexcept |
| Default construct, as zero-initialized. | |
| constexpr | complex (Foam::zero) noexcept |
| Construct zero-initialized from zero class. | |
| constexpr | complex (const scalar r) noexcept |
| Construct from real component. | |
| constexpr | complex (const scalar r, const scalar i) noexcept |
| Construct from real and imaginary parts. | |
| complex (const std::complex< float > &c) | |
| Implicit construct from std::complex. | |
| complex (const std::complex< double > &c) | |
| Implicit construct from std::complex. | |
| complex (Istream &is) | |
| Construct from Istream. | |
| constexpr scalar | real () const noexcept |
| Real part of complex number - STL naming. | |
| constexpr scalar | imag () const noexcept |
| Imaginary part of complex number - STL naming. | |
| void | real (scalar val) noexcept |
| Set real part of complex number - STL naming. | |
| void | imag (scalar val) noexcept |
| Set imaginary part of complex number - STL naming. | |
| complex | conjugate () const |
| Complex conjugate. | |
| scalar | magnitude () const |
| The magnitude (L2-norm) of complex. Called magnitude() instead mag(), which looks too much like imag(). | |
| scalar | magSqr () const |
| The L2-norm squared of complex. | |
| scalar | cmptSum () const noexcept |
| The sum of real/imag components. | |
| operator std::complex< scalar > () const | |
| Implicit conversion to std::complex. | |
| void | operator= (Foam::zero) |
| Assign zero. | |
| void | operator= (const scalar s) |
| Assign scalar (imag = zero). | |
| 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(). | |
| scalar | Im () const noexcept |
| Get imaginary part of complex number. Same as imag(). | |
| scalar & | Re () noexcept |
| Non-const access to real part. Prefer real() setter method. | |
| scalar & | Im () noexcept |
| Non-const access to imaginary part. Prefer imag() setter method. | |
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.
|
defaultnoexcept |
Copy construct.
References complex().
Referenced by complex(), complex(), conjugate(), pTraits< complex >::operator complex(), pTraits< complex >::operator complex &(), operator std::complex< scalar >(), operator!=(), operator*, operator*, operator*, operator*=(), operator+, operator+, operator+, operator+=(), operator-, operator-, operator-, operator-, operator-=(), operator/, operator/, operator/, operator/=(), operator=(), operator=(), operator==(), and pTraits< complex >::pTraits().


|
defaultnoexcept |
|
inlineconstexprnoexcept |
Default construct, as zero-initialized.
Definition at line 24 of file complexI.H.
References Foam::noexcept.
|
inlineconstexprnoexcept |
Construct zero-initialized from zero class.
Definition at line 31 of file complexI.H.
References Foam::noexcept.
|
inlineexplicitconstexprnoexcept |
|
inlineconstexprnoexcept |
Construct from real and imaginary parts.
Definition at line 45 of file complexI.H.
References Foam::noexcept.
|
inline |
Implicit construct from std::complex.
Definition at line 52 of file complexI.H.
References imag(), and real().

|
inline |
Implicit construct from std::complex.
Definition at line 59 of file complexI.H.
References imag(), and real().

Move assignment.
References complex(), and Foam::noexcept.

|
inlineconstexprnoexcept |
Real part of complex number - STL naming.
Definition at line 150 of file complex.H.
References Foam::noexcept, and real().
Referenced by complex(), complex(), Foam::lerp(), and real().


|
inlineconstexprnoexcept |
Imaginary part of complex number - STL naming.
Definition at line 155 of file complex.H.
References Foam::noexcept.
Referenced by complex(), complex(), and Foam::lerp().

|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Complex conjugate.
Definition at line 68 of file complexI.H.
References complex().
Referenced by Foam::operator&().


|
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.
|
inline |
The L2-norm squared of complex.
Definition at line 80 of file complexI.H.
|
inlinenoexcept |
The sum of real/imag components.
Definition at line 86 of file complexI.H.
References Foam::noexcept.
|
inline |
|
inline |
Assign zero.
Definition at line 94 of file complexI.H.
|
inline |
Assign scalar (imag = zero).
Definition at line 101 of file complexI.H.
References s().

|
inline |
Definition at line 108 of file complexI.H.
References complex().

|
inline |
Definition at line 115 of file complexI.H.
References s().

|
inline |
Definition at line 121 of file complexI.H.
References complex().

|
inline |
Definition at line 128 of file complexI.H.
References s().

|
inline |
Definition at line 134 of file complexI.H.
References complex().

|
inline |
Definition at line 140 of file complexI.H.
References s().

|
inline |
Definition at line 147 of file complexI.H.
References complex().

|
inline |
Definition at line 153 of file complexI.H.
References s().

|
inline |
Definition at line 160 of file complexI.H.
References complex(), and Foam::equal().

|
inline |
Definition at line 166 of file complexI.H.
References complex(), and Foam::operator==().

|
inlinenoexcept |
Get real part of complex number. Same as real().
Definition at line 255 of file complex.H.
References Foam::noexcept.
|
inlinenoexcept |
Get imaginary part of complex number. Same as imag().
Definition at line 260 of file complex.H.
References Foam::noexcept.
|
inlinenoexcept |
Non-const access to real part. Prefer real() setter method.
Definition at line 265 of file complex.H.
References Foam::noexcept.
|
inlinenoexcept |
Non-const access to imaginary part. Prefer imag() setter method.
Definition at line 270 of file complex.H.
References Foam::noexcept.
Definition at line 279 of file complexI.H.
References complex().
Definition at line 285 of file complexI.H.
References complex().
Definition at line 295 of file complexI.H.
Definition at line 301 of file complexI.H.
Definition at line 307 of file complexI.H.
References complex().
Definition at line 317 of file complexI.H.
Definition at line 323 of file complexI.H.
Definition at line 329 of file complexI.H.
References complex().
Definition at line 339 of file complexI.H.
Definition at line 345 of file complexI.H.
Definition at line 351 of file complexI.H.
References complex().
Definition at line 363 of file complexI.H.
Definition at line 369 of file complexI.H.