#include <MathFunctions.h>
Static Public Member Functions | |
static double | legendre (int l, double x) |
Legendre polynomial order l at x. | |
static double | erf (double x) |
Returns the error function of a double. | |
static double | erfc (double x) |
Returns the complementary error function of a double. | |
static double | F_gamma (double v, double t) |
static double | gamma_inc (double a, double x) |
static double | gamma_log (double x2) |
static double | gamma_series (double a, double x) |
static double | gamma_cf (double a, double x) |
static double | accel_G (double n, double x, double y, double a, double zeta) |
Used for Umrigar's spherical metropolis sampling. | |
static void | fitU (double Z, double Frk, double r, double delta, double &zeta, double &a, double &I) |
static double | rij (Array2D< double > &R, int i, int j) |
Calculates distance between electrons i and j based on the coordinates found in R. | |
static double | rij (Array2D< double > &positioni, Array2D< double > &positionj, int i, int j) |
Calculates the distance between particles i and j, where i is found in positioni and j is found in positionj. | |
static double | fast_exp (double x) |
This function was copied from: On a Fast, Compact Approximation of the Exponential Function by Gavin C Cawley in Neural Computation 12, 2009-2012 (2000). | |
Static Public Attributes | |
static const double | pi = 3.141592653589793 |
Static Private Member Functions | |
static double | csevl (double x, double *coef, int lengthCoef) |
Evaluates a Chebyschev series. | |
static double | sign (double x, double y) |
Definition at line 26 of file MathFunctions.h.
double MathFunctions::legendre | ( | int | l, | |
double | x | |||
) | [static] |
Legendre polynomial order l at x.
Definition at line 413 of file MathFunctions.cpp.
Referenced by QMCMolecule::readPsuedoPotential().
double MathFunctions::erf | ( | double | x | ) | [static] |
Returns the error function of a double.
x | A double value. |
Definition at line 15 of file MathFunctions.cpp.
double MathFunctions::erfc | ( | double | x | ) | [static] |
Returns the complementary error function of a double.
x | A double value. |
Definition at line 63 of file MathFunctions.cpp.
References csevl().
Referenced by erf().
double MathFunctions::F_gamma | ( | double | v, | |
double | t | |||
) | [static] |
Definition at line 297 of file MathFunctions.cpp.
References gamma_inc().
Referenced by QMCPsiPotential::OverlapVGaussians().
double MathFunctions::gamma_inc | ( | double | a, | |
double | x | |||
) | [static] |
double MathFunctions::gamma_log | ( | double | x2 | ) | [static] |
double MathFunctions::gamma_series | ( | double | a, | |
double | x | |||
) | [static] |
double MathFunctions::gamma_cf | ( | double | a, | |
double | x | |||
) | [static] |
Definition at line 377 of file MathFunctions.cpp.
References EPS, FPMIN, gamma_log(), and ITMAX.
Referenced by gamma_inc().
double MathFunctions::accel_G | ( | double | n, | |
double | x, | |||
double | y, | |||
double | a, | |||
double | zeta | |||
) | [static] |
Used for Umrigar's spherical metropolis sampling.
Look in A.4 of "Variational Monte Carlo Basics and Applications to Atoms and Molecules" by C. J. Umrigar NATO ASI Series, Series C, Mathematical and Physical Sciences, Vol. C-525, (Kluwer Academic Publishers, Boston, 1999)
Definition at line 258 of file MathFunctions.cpp.
References gamma_inc().
Referenced by fitU().
void MathFunctions::fitU | ( | double | Z, | |
double | Frk, | |||
double | r, | |||
double | delta, | |||
double & | zeta, | |||
double & | a, | |||
double & | I | |||
) | [static] |
Definition at line 194 of file MathFunctions.cpp.
References accel_G().
Referenced by QMCWalker::calculateReverseGreensFunctionUmrigar93AcceleratedSampling(), and QMCWalker::moveElectronsUmrigar93AcceleratedSampling().
double MathFunctions::rij | ( | Array2D< double > & | R, | |
int | i, | |||
int | j | |||
) | [static] |
Calculates distance between electrons i and j based on the coordinates found in R.
Definition at line 423 of file MathFunctions.cpp.
Referenced by QMCPotential_Energy::calc_P_nn(), QMCThreeBodyJastrow::jastrowOnGrid(), QMCJastrowElectronNuclear::jastrowOnGrid(), QMCJastrowElectronElectron::jastrowOnGrid(), and QMCWalkerData::updateDistances().
double MathFunctions::rij | ( | Array2D< double > & | positioni, | |
Array2D< double > & | positionj, | |||
int | i, | |||
int | j | |||
) | [static] |
Calculates the distance between particles i and j, where i is found in positioni and j is found in positionj.
Definition at line 435 of file MathFunctions.cpp.
double MathFunctions::fast_exp | ( | double | x | ) | [static] |
This function was copied from: On a Fast, Compact Approximation of the Exponential Function by Gavin C Cawley in Neural Computation 12, 2009-2012 (2000).
which is itself based on: A Fast, Compact Approximation of the Exponential Function by Nicol N Schraudolph in Neural Computation 11, 853-862 (1999)
Essentially, it's taking advantage of the fact that the exponent term in a floating point double is 2^x and is only different from exp(x) by a change of base formula. The function is essentially free, but you get ~1% error.
Definition at line 451 of file MathFunctions.cpp.
Referenced by QMCBasisFunction::evaluateBasisFunctions().
double MathFunctions::csevl | ( | double | x, | |
double * | coef, | |||
int | lengthCoef | |||
) | [static, private] |
double MathFunctions::sign | ( | double | x, | |
double | y | |||
) | [static, private] |
const double MathFunctions::pi = 3.141592653589793 [static] |
Definition at line 103 of file MathFunctions.h.