Loading...
Searching...
No Matches
pTraits< complex > Class Reference

Template specialisation for pTraits<complex>. More...

#include <complex.H>

Inheritance diagram for pTraits< complex >:
Collaboration diagram for pTraits< complex >:

Public Types

typedef complex cmptType
 Component type.
typedef scalar magType
 Magnitude type.
typedef label labelType
 Equivalent type of labels used for valid component indexing.

Public Member Functions

 pTraits (const complex &val) noexcept
 Copy construct from primitive.
 pTraits (Istream &is)
 Read construct from Istream.
 operator complex () const noexcept
 Return the value.
 operator complex & () noexcept
 Access the value.
Public Member Functions inherited from complex
 complex (const complex &) noexcept=default
 Copy construct.
complexoperator= (const complex &) noexcept=default
 Copy assignment.
 complex (complex &&) noexcept=default
 Move construct.
complexoperator= (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.

Static Public Attributes

static constexpr direction dim = 3
 Dimensionality of space.
static constexpr direction rank = 0
 Rank of complex is 0.
static constexpr direction nComponents = 2
 Number of components in complex is 2.
static const char *const typeName
static const char *const componentNames []
static const complex zero
 complex (0,0)
static const complex one
 complex (1,0)
static const complex min
 complex (-VGREAT,-VGREAT)
static const complex max
 complex (VGREAT,VGREAT)
static const complex rootMin
 complex (-ROOTVGREAT, -ROOTVGREAT)
static const complex rootMax
 complex (ROOTVGREAT, ROOTVGREAT)

Detailed Description

Template specialisation for pTraits<complex>.

Definition at line 301 of file complex.H.

Member Typedef Documentation

◆ cmptType

typedef complex cmptType

Component type.

Definition at line 312 of file complex.H.

◆ magType

typedef scalar magType

Magnitude type.

Definition at line 317 of file complex.H.

◆ labelType

typedef label labelType

Equivalent type of labels used for valid component indexing.

Definition at line 322 of file complex.H.

Constructor & Destructor Documentation

◆ pTraits() [1/2]

pTraits ( const complex & val)
inlineexplicitnoexcept

Copy construct from primitive.

Definition at line 361 of file complex.H.

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

Here is the call graph for this function:

◆ pTraits() [2/2]

pTraits ( Istream & is)
explicit

Read construct from Istream.

Member Function Documentation

◆ operator complex()

operator complex ( ) const
inlinenoexcept

Return the value.

Definition at line 375 of file complex.H.

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

Here is the call graph for this function:

◆ operator complex &()

operator complex & ( )
inlinenoexcept

Access the value.

Definition at line 380 of file complex.H.

References complex::complex().

Here is the call graph for this function:

Member Data Documentation

◆ dim

direction dim = 3
staticconstexpr

Dimensionality of space.

Definition at line 330 of file complex.H.

◆ rank

direction rank = 0
staticconstexpr

Rank of complex is 0.

Definition at line 335 of file complex.H.

◆ nComponents

direction nComponents = 2
staticconstexpr

Number of components in complex is 2.

Definition at line 340 of file complex.H.

◆ typeName

const char* const typeName
static

Definition at line 345 of file complex.H.

◆ componentNames

const char* const componentNames[]
static

Definition at line 346 of file complex.H.

◆ zero

const complex zero
static

complex (0,0)

Definition at line 348 of file complex.H.

◆ one

const complex one
static

complex (1,0)

Definition at line 349 of file complex.H.

◆ min

const complex min
static

complex (-VGREAT,-VGREAT)

Definition at line 350 of file complex.H.

◆ max

const complex max
static

complex (VGREAT,VGREAT)

Definition at line 351 of file complex.H.

◆ rootMin

const complex rootMin
static

complex (-ROOTVGREAT, -ROOTVGREAT)

Definition at line 352 of file complex.H.

◆ rootMax

const complex rootMax
static

complex (ROOTVGREAT, ROOTVGREAT)

Definition at line 353 of file complex.H.


The documentation for this class was generated from the following files: