Triumvirate C++ API 0.5.0.post1.dev301+g026f21751
Three-point clustering measurements in large-scale structure analyses.
Loading...
Searching...
No Matches
trv::maths Namespace Reference

Classes

class  HankelTransform
 Perform the (forward biased) Hankel and associated transforms using the FFTLog algorithm. More...
 
class  SphericalBesselCalculator
 Interpolated spherical Bessel function \( j_\ell(x) \) of the first kind. More...
 
class  SphericalBesselTransform
 
class  SphericalHarmonicCalculator
 Reduced spherical harmonics. More...
 

Functions

std::complex< double > eval_complex_in_polar (double r, double theta)
 Evaluate a complex number \( r e^{i \theta} \) in the polar form.
 
double get_vec3d_magnitude (std::vector< double > vec)
 Return the magnitude of a 3-d vector.
 
double get_vec3d_magnitude (double *vec)
 Return the magnitude of a 3-d vector.
 
std::complex< double > eval_lanczos_approx_series (std::complex< double > z)
 Evaluate the Lanczos approximation series \( A_g(z) \) for the gamma function.
 
std::complex< double > eval_gamma_lanczos (std::complex< double > z)
 Evaluate the gamma function \( \Gamma(z) \) on the complex plane using the Lanczos approximation.
 
void get_lngamma_parts (double x, double y, double &lnr, double &theta)
 Get the real and imaginary parts of the log-gamma function \( \ln\Gamma(z = x + \mathrm{i}\,y) \).
 
std::complex< double > eval_gamma_lnratio (double mu, std::complex< double > nu)
 Evaluate the logarithm of the ratio of two gamma functions.
 
double wigner_3j (int j1, int j2, int j3, int m1, int m2, int m3)
 Calculate Wigner 3-j symbol.
 

Variables

const std::complex< double > M_I
 imaginary unit
 
const double eps_coupling = 1.e-9
 zero-tolerance for Wigner 3-j coupling coefficients
 
const double gconst_lanczos = 7.
 Lanczos approximation constant.
 

Function Documentation

◆ eval_complex_in_polar()

std::complex< double > trv::maths::eval_complex_in_polar ( double r,
double theta )

Evaluate a complex number \( r e^{i \theta} \) in the polar form.

Parameters
rModulus \( r \).
thetaArgument \( \theta \).
Returns
Value of the complex number.

Definition at line 44 of file maths.cpp.

+ Here is the caller graph for this function:

◆ get_vec3d_magnitude() [1/2]

double trv::maths::get_vec3d_magnitude ( std::vector< double > vec)

Return the magnitude of a 3-d vector.

Parameters
vecA 3-d vector.
Returns
Vector magnitude.

Definition at line 53 of file maths.cpp.

+ Here is the caller graph for this function:

◆ get_vec3d_magnitude() [2/2]

double trv::maths::get_vec3d_magnitude ( double * vec)

Return the magnitude of a 3-d vector.

Parameters
vecA 3-d vector.
Returns
Vector magnitude.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 57 of file maths.cpp.

◆ eval_lanczos_approx_series()

std::complex< double > trv::maths::eval_lanczos_approx_series ( std::complex< double > z)

Evaluate the Lanczos approximation series \( A_g(z) \) for the gamma function.

The series approximate the gamma function by

\[ \Gamma(z + 1) = \sqrt{2\pi} (z + g + 1/2)^{z + 1/2} \mathrm{e}^{- z - g - 1/2} A_g(z) \]

where \( g \) is the Lanczos constant.

Here \( g = 7 \) is chosen with \( N = 9 \) terms in the series \( A_g(z) \).

Parameters
zComplex argument.
Returns
Value of \( A_g(z) \).

Definition at line 73 of file maths.cpp.

+ Here is the caller graph for this function:

◆ eval_gamma_lanczos()

std::complex< double > trv::maths::eval_gamma_lanczos ( std::complex< double > z)

Evaluate the gamma function \( \Gamma(z) \) on the complex plane using the Lanczos approximation.

Here the Lanczos approximation series \( A_g(z) \) uses \( g = 7 \) with \( N = 9 \) terms.

Parameters
zComplex argument.
Returns
Value of \( \Gamma(z) \).
See also
trv::eval_lanczos_approx_series()

Definition at line 98 of file maths.cpp.

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

◆ get_lngamma_parts()

void trv::maths::get_lngamma_parts ( double x,
double y,
double & lnr,
double & theta )

Get the real and imaginary parts of the log-gamma function \( \ln\Gamma(z = x + \mathrm{i}\,y) \).

Parameters
[in]xReal part of the complex argument.
[in]yImaginary part of the complex argument.
[out]lnrReal part of the log-gamma function value.
[out]thetaImaginary part of the log-gamma function value.
See also
gsl_sf_lngamma_complex_e() used to evaluate the log-gamma function with complex argument.

Definition at line 122 of file maths.cpp.

+ Here is the caller graph for this function:

◆ eval_gamma_lnratio()

std::complex< double > trv::maths::eval_gamma_lnratio ( double mu,
std::complex< double > nu )

Evaluate the logarithm of the ratio of two gamma functions.

The ratio is of the form \( \Gamma\big(\frac{\mu + \nu + 1}{2}\big) \big/ \Gamma\big(\frac{\mu - \nu + 1}{2}\big) \,, \) where \( \mu \) and \( \mathrm{Re}\,\{\nu\} \) are small, while \( \mathrm{Im}\,\{\nu\} \) may be large, in which case the Stirling approximation is used.

Parameters
muReal variable.
nuComplex variable.
Returns
Logarithmic ratio.

Definition at line 130 of file maths.cpp.

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

◆ wigner_3j()

double trv::maths::wigner_3j ( int j1,
int j2,
int j3,
int m1,
int m2,
int m3 )

Calculate Wigner 3-j symbol.

Parameters
j1,j2,j3,m1,m2,m3Wigner 3-j symbol components.
Returns
Value of the Wigner 3-j symbol.

Definition at line 167 of file maths.cpp.

+ Here is the caller graph for this function:

Variable Documentation

◆ M_I

const std::complex<double> trv::maths::M_I
extern

imaginary unit

◆ eps_coupling

const double trv::maths::eps_coupling = 1.e-9

zero-tolerance for Wigner 3-j coupling coefficients

Definition at line 165 of file maths.cpp.

◆ gconst_lanczos

const double trv::maths::gconst_lanczos = 7.

Lanczos approximation constant.

Definition at line 71 of file maths.cpp.