Mathematical Functions and Constants
Binomial and Factorial
The binomial coefficients, (n,m), and the
factorial, n!, are available inside namespace
Vincia
as:
int factorial(int n)
int binomial(int n, int m)
Dilogarithms
The dilogarithm, Li2(x), is available inside namespace
Vincia
as:
double Li2(double x, double kmax, double xerr)
The Gamma Function
The Gamma function, Gamma(x) is implemented for x >
0, and is based on the approximation by Lanczos (see Numerical
Recipes). Two function calls are availabe inside namespace
Vincia
:
double lnGamma(double x)
double Gamma(double x)
The former is often more useful in calculations involving ratios of
the Gamma function with large numbers, which would be cast as
differences of logs.
Numerical Integration and Root Finding
double integrateGauss(double (*fun)(double), double xlo, double xhi,
double tol);
double zbrent(double (*fun)(double), double r, double x1, double
x2, double tol);
One-dimensional Splines
-
void makeSpline(vector< double>& x, vector< double>& y,
vector< double>& y2);
double getSpline(const double x, vector< double>& xa,
vector< double>& ya, vector< double>&
y2a);