mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
mx::math::func Namespace Reference

Classes

struct  emgModeFunc
 

Functions

template<typename realT >
realT airyPattern (realT x)
 The classical Airy pattern.
 
template<typename realT >
realT airyPattern (realT x, realT eps)
 The centrally obscured Airy pattern.
 
template<typename realT >
realT airyPattern (realT x, realT y, realT A0, realT A, realT x0, realT y0, realT ps, realT eps)
 The general centrally obscured Airy pattern, with arbitrary center and platescale.
 
template<typename realT >
void airyPattern2D (realT *arr, size_t nx, size_t ny, const realT A0, const realT A, const realT x0, const realT y0, realT ps)
 Fill in an array with the 2D arbitrarily-centered classical Airy pattern.
 
template<typename realT >
realT seeingHalo (realT x, realT fwhm)
 Seeing Halo Profile.
 
template<typename realT >
realT airyPatternEnclosed (realT x)
 Calculate the fraction of enclosed power at a given radius for the unobscured Airy Pattern.
 
template<typename realT >
realT apeInt (realT x, void *params)
 
template<typename realT >
realT airyPatternEnclosed (realT x, realT eps)
 Calculate the fraction of enclosed power at a given radius for the centrally obscured Airy Pattern.
 
template<typename T1 , typename T2 >
T2 bessel_j (T1 v, T2 x)
 Bessel Functions of the First Kind.
 
template<>
float bessel_j< float, float > (float v, float x)
 
template<>
float bessel_j< int, float > (int v, float x)
 
template<>
double bessel_j< double, double > (double v, double x)
 
template<>
double bessel_j< int, double > (int v, double x)
 
template<>
long double bessel_j< long double, long double > (long double v, long double x)
 
template<>
long double bessel_j< int, long double > (int v, long double x)
 
template<typename realT >
realT expModGaussian (realT x, realT mu, realT sigma, realT lambda)
 The Exponentially Modified Gaussian at a point.
 
template<typename realT >
realT expModGaussianMean (realT mu, realT lambda)
 The Mean of the Exponentially Modified Gaussian.
 
template<typename realT >
realT expModGaussianVariance (realT sigma, realT lambda)
 The Variance of the Exponentially Modified Gaussian.
 
template<typename realT >
realT expModGaussianMode (realT mu, realT sigma, realT lambda)
 The Mode of the Exponentially Modified Gaussian.
 
template<typename T >
factorial (T x)
 The factorial function.
 
template<>
float factorial< float > (float x)
 
template<>
double factorial< double > (double x)
 
template<>
long double factorial< long double > (long double x)
 
template<typename T >
tgamma (T x)
 The Gamma Function.
 
template<>
float tgamma< float > (float x)
 
template<>
double tgamma< double > (double x)
 
template<>
long double tgamma< long double > (long double x)
 
template<typename realT >
realT gammaDistributionDenom (realT k, realT q)
 The denominator of the Gamma Distribution.
 
template<typename realT >
realT gammaDistribution (realT x, realT x0, realT k, realT q, realT denom)
 The general shifted Gamma Distribution at a point using an arbitrary peak scaling parameter.
 
template<typename realT >
realT gammaDistribution (realT x, realT x0, realT k, realT q)
 The general shifted Gamma Distribution at a point.
 
template<typename realT >
realT gammaDistributionMean (realT x0, realT k, realT theta)
 The mean of the Gamma Distribution.
 
template<typename realT >
realT gammaDistributionMode (realT x0, realT k, realT theta)
 The mode of the Gamma Distribution.
 
template<typename realT >
realT gammaDistributionVariance (realT k, realT theta)
 The variance of the Gamma Distribution.
 
template<typename floatT >
constexpr floatT twosqrt2log2 ()
 Constant to convert between the Gaussian width parameter and FWHM.
 
template<typename floatT >
floatT fwhm2sigma (floatT fw)
 Convert from FWHM to the Gaussian width parameter.
 
template<typename floatT >
floatT sigma2fwhm (floatT sig)
 Convert from Gaussian width parameter to FWHM.
 
template<typename realT >
realT gaussian (const realT x, const realT G0, const realT G, const realT x0, const realT sigma)
 Find value at position (x) of the 1D arbitrarily-centered symmetric Gaussian.
 
template<typename realT >
realT gaussian2D (const realT x, const realT y, const realT G0, const realT G, const realT x0, const realT y0, const realT sigma)
 Find value at position (x,y) of the 2D arbitrarily-centered symmetric Gaussian.
 
template<typename realT >
void gaussian2D (realT *arr, size_t nx, size_t ny, const realT G0, const realT G, const realT x0, const realT y0, const realT sigma)
 Fill in an array with the 2D arbitrarily-centered symmetric Gaussian.
 
template<typename realT >
realT gaussian2D (const realT x, const realT y, const realT G0, const realT G, const realT x0, const realT y0, const realT a, const realT b, const realT c)
 Find value at position (x,y) of the 2D general elliptical Gaussian.
 
template<typename realT >
void gaussian2D_gen2rot (realT &sigma_x, realT &sigma_y, realT &theta, const realT a, const realT b, const realT c)
 Convert from (a,b,c) to ( \(\sigma_x\), \(\sigma_y\), \(\theta\)) for the elliptical Gaussian.
 
template<typename realT >
void gaussian2D_rot2gen (realT &a, realT &b, realT &c, const realT sigma_x, const realT sigma_y, const realT theta)
 Convert from ( \(\sigma_x\), \(\sigma_y\), \(\theta\)) to (a,b,c) for the elliptical Gaussian.
 
template<typename realT >
realT gaussian2D_ang (const realT x, const realT y, const realT G0, const realT G, const realT x0, const realT y0, const realT sigma_x, const realT sigma_y, const realT theta)
 Find value at position (x,y) of the 2D rotated elliptical Gaussian.
 
template<typename realT >
void gaussian2D (realT *arr, size_t nx, size_t ny, const realT G0, const realT G, const realT x0, const realT y0, const realT a, const realT b, const realT c)
 Fill in an array with the 2D general elliptical Gaussian.
 
template<typename realT >
void gaussian2D_ang (realT *arr, size_t nx, size_t ny, const realT G0, const realT G, const realT x0, const realT y0, const realT sigma_x, const realT sigma_y, const realT theta)
 Fill in an array with the 2D general elliptical Gaussian.
 
template<typename realT >
void gaussian2D_jacobian (realT *j, const realT x, const realT y, const realT G0, const realT G, const realT x0, const realT y0, const realT a, const realT b, const realT c)
 Calculate the Jacobian at position (x,y) for the 2D general elliptical Gaussian.
 
template<typename T >
jinc (const T &x)
 The Jinc function.
 
template float jinc< float > (const float &x)
 
template double jinc< double > (const double &x)
 
template long double jinc< long double > (const long double &x)
 
template<typename T1 , typename T2 >
T2 jincN (const T1 &v, const T2 &x)
 The JincN function.
 
template float jincN< float, float > (const float &v, const float &x)
 
template float jincN< int, float > (const int &v, const float &x)
 
template double jincN< double, double > (const double &v, const double &x)
 
template double jincN< int, double > (const int &v, const double &x)
 
template long double jincN< long double, long double > (const long double &v, const long double &x)
 
template long double jincN< int, long double > (const int &v, const long double &x)
 
template<typename T >
legendre_p (int n, T x)
 Legendre Polynomials.
 
template<>
float legendre_p< float > (int n, float x)
 
template<>
double legendre_p< double > (int n, double x)
 
template<>
long double legendre_p< long double > (int n, long double x)
 
template<typename T >
orthoNormalLegendre (int n, T x)
 The orthonormal Legendre polynomials.
 
template<typename floatT >
floatT logistic_param (floatT x, floatT thalf)
 Return the logistic function parameter for a specified rise time.
 
template<typename floatT >
floatT logistic (floatT t, floatT t0=0, floatT a=1)
 Return the value of the logistic function.
 
template<typename realT >
realT moffat (const realT x, const realT I0, const realT Ipk, const realT x0, const realT alpha, const realT beta)
 Find value at position (x) of the 1D arbitrarily-centered symmetric unnormalized Moffat function.
 
template float moffat< float > (const float x, const float I0, const float Ipk, const float x0, const float alpha, const float beta)
 
template double moffat< double > (const double x, const double I0, const double Ipk, const double x0, const double alpha, const double beta)
 
template long double moffat< long double > (const long double x, const long double I0, const long double Ipk, const long double x0, const long double alpha, const long double beta)
 
template<typename realT >
realT moffat2D (const realT x, const realT y, const realT I0, const realT Ipk, const realT x0, const realT y0, const realT alpha, const realT beta)
 Find value at position (x,y) of the 2D arbitrarily-centered unnormalized symmetric Moffat function.
 
template float moffat2D< float > (const float x, const float y, const float I0, const float Ipk, const float x0, const float y0, const float alpha, const float beta)
 
template double moffat2D< double > (const double x, const double y, const double I0, const double Ipk, const double x0, const double y0, const double alpha, const double beta)
 
template long double moffat2D< long double > (const long double x, const long double y, const long double I0, const long double Ipk, const long double x0, const long double y0, const long double alpha, const long double beta)
 
template<typename realT >
realT moffatFWHM (realT alpha, realT beta)
 Compute the full-width at half-maximum of a Moffat profile.
 
template float moffatFWHM (float alpha, float beta)
 
template double moffatFWHM (double alpha, double beta)
 
template long double moffatFWHM (long double alpha, long double beta)
 
template<typename T >
root_epsilon ()
 Get the sqrt(epsilon) where epsilon is machine precision.
 
template<>
float root_epsilon< float > ()
 
template<>
double root_epsilon< double > ()
 
template<typename T >
sign (T x)
 The sign function.
 
template<>
float sign< float > (float x)
 
template<>
double sign< double > (double x)
 
template<>
long double sign< long double > (long double x)
 
template<typename realT >
realT weibull_lambda (std::vector< realT > &x, realT k, realT x0=0)
 The MLE of the Weibull distribution lambda parameter.
 
template<typename realT >
realT weibull (realT x, realT x0, realT k, realT lambda)
 The general shifted Weibull distribution at a point.
 
template<typename realT >
realT weibull (realT x, realT k, realT lambda)
 The Weibull distribution at a point.
 

Function Documentation

◆ apeInt()

template<typename realT >
realT mx::math::func::apeInt ( realT  x,
void params 
)

Definition at line 188 of file airyPattern.hpp.

References mx::math::six_fifths().

◆ bessel_j< double, double >()

template<>
double mx::math::func::bessel_j< double, double > ( double  v,
double  x 
)

◆ bessel_j< float, float >()

template<>
float mx::math::func::bessel_j< float, float > ( float  v,
float  x 
)

◆ bessel_j< int, double >()

template<>
double mx::math::func::bessel_j< int, double > ( int  v,
double  x 
)

◆ bessel_j< int, float >()

template<>
float mx::math::func::bessel_j< int, float > ( int  v,
float  x 
)

◆ bessel_j< int, long double >()

template<>
long double mx::math::func::bessel_j< int, long double > ( int  v,
long double  x 
)

◆ bessel_j< long double, long double >()

◆ factorial< double >()

◆ factorial< float >()

◆ factorial< long double >()

◆ jinc< double >()

◆ jinc< float >()

◆ jinc< long double >()

◆ jincN< double, double >()

◆ jincN< float, float >()

◆ jincN< int, double >()

◆ jincN< int, float >()

template float mx::math::func::jincN< int, float > ( const int v,
const float x 
)
extern

◆ jincN< int, long double >()

◆ jincN< long double, long double >()

◆ legendre_p< double >()

template<>
double mx::math::func::legendre_p< double > ( int  n,
double  x 
)

◆ legendre_p< float >()

template<>
float mx::math::func::legendre_p< float > ( int  n,
float  x 
)

◆ legendre_p< long double >()

◆ moffat2D< double >()

template double mx::math::func::moffat2D< double > ( const double  x,
const double  y,
const double  I0,
const double  Ipk,
const double  x0,
const double  y0,
const double  alpha,
const double  beta 
)
extern

Referenced by SCENARIO().

◆ moffat2D< float >()

template float mx::math::func::moffat2D< float > ( const float  x,
const float  y,
const float  I0,
const float  Ipk,
const float  x0,
const float  y0,
const float  alpha,
const float  beta 
)
extern

◆ moffat2D< long double >()

◆ moffat< double >()

template double mx::math::func::moffat< double > ( const double  x,
const double  I0,
const double  Ipk,
const double  x0,
const double  alpha,
const double  beta 
)
extern

Referenced by SCENARIO().

◆ moffat< float >()

template float mx::math::func::moffat< float > ( const float  x,
const float  I0,
const float  Ipk,
const float  x0,
const float  alpha,
const float  beta 
)
extern

◆ moffat< long double >()

◆ moffatFWHM() [1/3]

template double mx::math::func::moffatFWHM ( double  alpha,
double  beta 
)
extern

◆ moffatFWHM() [2/3]

template float mx::math::func::moffatFWHM ( float  alpha,
float  beta 
)
extern

◆ moffatFWHM() [3/3]

template long double mx::math::func::moffatFWHM ( long double  alpha,
long double  beta 
)
extern

◆ orthoNormalLegendre()

template<typename T >
T mx::math::func::orthoNormalLegendre ( int  n,
x 
)

The orthonormal Legendre polynomials.

A version of the Legendre polynomials which are orthonormal on the interval -1 <= x <= 1.

Returns
the value of the n-th orthonormal Legendre polynomial at x.

Definition at line 87 of file legendre.hpp.

References mx::math::six_fifths().

◆ root_epsilon< double >()

◆ root_epsilon< float >()

◆ sign< double >()

template<>
double mx::math::func::sign< double > ( double  x)

◆ sign< float >()

template<>
float mx::math::func::sign< float > ( float  x)

◆ sign< long double >()

◆ tgamma< double >()

◆ tgamma< float >()

template<>
float mx::math::func::tgamma< float > ( float  x)

◆ tgamma< long double >()