MathFunctions Class Reference

A set of basic mathematical functions. More...

#include <MathFunctions.h>

List of all members.

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)


Detailed Description

A set of basic mathematical functions.

Definition at line 26 of file MathFunctions.h.


Member Function Documentation

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.

Parameters:
x A double value.
Returns:
The error function of x.

Definition at line 15 of file MathFunctions.cpp.

References csevl(), erfc(), and sign().

double MathFunctions::erfc ( double  x  )  [static]

Returns the complementary error function of a double.

Parameters:
x A double value.
Returns:
The complementary error function of x.

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]

Definition at line 309 of file MathFunctions.cpp.

References gamma_cf(), and gamma_series().

Referenced by accel_G(), and F_gamma().

double MathFunctions::gamma_log ( double  x2  )  [static]

Definition at line 324 of file MathFunctions.cpp.

Referenced by gamma_cf().

double MathFunctions::gamma_series ( double  a,
double  x 
) [static]

Definition at line 350 of file MathFunctions.cpp.

References EPS, and ITMAX.

Referenced by gamma_inc().

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]

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.

References EXP_A, and EXP_C.

Referenced by QMCBasisFunction::evaluateBasisFunctions().

double MathFunctions::csevl ( double  x,
double *  coef,
int  lengthCoef 
) [static, private]

Evaluates a Chebyschev series.

Definition at line 267 of file MathFunctions.cpp.

Referenced by erf(), and erfc().

double MathFunctions::sign ( double  x,
double  y 
) [static, private]

Definition at line 287 of file MathFunctions.cpp.

Referenced by erf().


Member Data Documentation

const double MathFunctions::pi = 3.141592653589793 [static]

Definition at line 103 of file MathFunctions.h.


The documentation for this class was generated from the following files:

Generated on Sat Jul 5 16:14:02 2008 for QMcBeaver by  doxygen 1.5.6