Foam::Math Namespace Reference

A namespace for various mathematical functions. More...

Functions

scalar erfInv (const scalar y)
 Inverse error function of a real-number argument. More...
 
scalar invIncGamma (const scalar a, const scalar P)
 Inverse of regularised lower incomplete gamma function. More...
 
scalar incGammaRatio_Q (const scalar a, const scalar x)
 Regularised upper incomplete gamma function. More...
 
scalar incGammaRatio_P (const scalar a, const scalar x)
 Regularised lower incomplete gamma function. More...
 
scalar incGamma_Q (const scalar a, const scalar x)
 Upper incomplete gamma function. More...
 
scalar incGamma_P (const scalar a, const scalar x)
 Lower incomplete gamma function. More...
 

Detailed Description

A namespace for various mathematical functions.

Reference:

    Inverse error function (tag:W):
        Winitzki, S. (2008).
        A handy approximation for the error function and its inverse.
        A lecture note obtained through private communication.
        URL:https://sites.google.com/site/winitzki/sergei-winitzkis-files
        (Retrieved on: 16 Feb 2021).

    Incomplete gamma functions (tag:DM):
        DiDonato, A. R., & Morris Jr, A. H. (1986).
        Computation of the incomplete gamma
        function ratios and their inverse.
        ACM Transactions on Mathematical Software (TOMS), 12(4), 377-393.
        DOI:10.1145/22721.23109
Note
  • The algorithm in invIncGamma is described in (DM:Sec. 4).
  • The algorithm in incGammaRatio_Q is described in (DM:Sec. 3).
  • The accuracy parameter IND is set to a value of 1.
Source files

Function Documentation

◆ erfInv()

Foam::scalar erfInv ( const scalar  y)

Inverse error function of a real-number argument.

Parameters
yReal-number argument at which to evaluate. Domain: (-1, 1)
Returns
The inverse of error function of y

Definition at line 36 of file erfInv.C.

References Foam::endl(), h, k, Foam::log(), Foam::mag(), Foam::nl, Foam::sqr(), Foam::sqrt(), WarningInFunction, x, and y.

Referenced by normal::sample(), and multiNormal::sample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ invIncGamma()

Foam::scalar invIncGamma ( const scalar  a,
const scalar  P 
)

Inverse of regularised lower incomplete gamma function.

Parameters
aReal-number argument. Domain: (0, infty]
PReal-number argument. Domain: [0,1]

Definition at line 93 of file invIncGamma.C.

References B, D, e, Foam::endl(), Foam::constant::mathematical::Eu(), Foam::exp(), Foam::lgamma(), Foam::log(), Foam::mag(), max(), Foam::minimaxs(), Foam::pow(), s(), Foam::Sn(), Foam::sqr(), Foam::sqrt(), WarningInFunction, and y.

Referenced by massRosinRammler::sample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ incGammaRatio_Q()

Foam::scalar incGammaRatio_Q ( const scalar  a,
const scalar  x 
)

Regularised upper incomplete gamma function.

Parameters
aReal-number argument. Domain: (0, infty]
xReal-number argument. Domain: [0, infty]

Definition at line 200 of file incGamma.C.

References alpha, Foam::calcPE15(), Foam::calcQE11(), Foam::calcQE16(), Foam::calcTE18(), Foam::endl(), Foam::erf(), Foam::erfc(), Foam::exp(), Foam::factorial(), H(), L, lambda(), Foam::log(), max(), n, phi, Foam::pow(), R, Foam::sqrt(), Foam::sum(), WarningInFunction, x, and y.

Referenced by incGamma_Q(), incGammaRatio_P(), and LuoSvendsen::LuoSvendsen().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ incGammaRatio_P()

Foam::scalar incGammaRatio_P ( const scalar  a,
const scalar  x 
)

Regularised lower incomplete gamma function.

Parameters
aReal-number argument. Domain: (0, infty]
xReal-number argument. Domain: [0, infty]

Definition at line 438 of file incGamma.C.

References incGammaRatio_Q(), and x.

Referenced by incGamma_P().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ incGamma_Q()

Foam::scalar incGamma_Q ( const scalar  a,
const scalar  x 
)

Upper incomplete gamma function.

Parameters
aReal-number argument. Domain: (0, infty]
xReal-number argument. Domain: [0, infty]

Definition at line 444 of file incGamma.C.

References incGammaRatio_Q(), and x.

Here is the call graph for this function:

◆ incGamma_P()

Foam::scalar incGamma_P ( const scalar  a,
const scalar  x 
)

Lower incomplete gamma function.

Parameters
aReal-number argument. Domain: (0, infty]
xReal-number argument. Domain: [0, infty]

Definition at line 450 of file incGamma.C.

References incGammaRatio_P(), and x.

Referenced by RosinRammler::meanValue(), and massRosinRammler::sample().

Here is the call graph for this function:
Here is the caller graph for this function: