LIBINT  2.1.0-stable
Static Public Member Functions | List of all members
libint2::FmEval_Reference< Real > Struct Template Reference

Computes the Boys function, $ F_m (T) = \int_0^1 u^{2m} \exp(-T u^2) \, {\rm d}u $, using single algorithm (asymptotic expansion). More...

#include <boys.h>

Static Public Member Functions

static Real eval (Real T, size_t m, Real absolute_precision)
 computes a single value of $ F_m(T) $ using MacLaurin series.
 
static void eval (Real *Fm, Real T, size_t mmax, Real absolute_precision)
 fills up an array of Fm(T) for m in [0,mmax] More...
 

Detailed Description

template<typename Real>
struct libint2::FmEval_Reference< Real >

Computes the Boys function, $ F_m (T) = \int_0^1 u^{2m} \exp(-T u^2) \, {\rm d}u $, using single algorithm (asymptotic expansion).

Slow for the sake of precision control. Useful in two cases:

Note
Precision is controlled heuristically, i.e. cannot be guaranteed mathematically; will stop if absolute precision is reached, or precision of Real is exhausted. It is important that std::numeric_limits<Real> is defined appropriately.
Template Parameters
Realthe type to use for all floating-point computations. Must be able to compute logarithm and exponential, i.e. log(x) and exp(x), where x is Real, must be valid expressions.

Member Function Documentation

template<typename Real >
static void libint2::FmEval_Reference< Real >::eval ( Real *  Fm,
Real  T,
size_t  mmax,
Real  absolute_precision 
)
inlinestatic

fills up an array of Fm(T) for m in [0,mmax]

Parameters
[out]Fmarray to be filled in with the Boys function values, must be at least mmax+1 elements long
[in]Tthe Boys function argument
[in]mmaxthe maximum value of m for which Boys function will be computed;
[in]absolute_precisionthe absolute precision to which to compute the result

downward recursion does not maintain absolute precision, only relative precision, and cannot be used for T > 10 if (mmax > 0) { const Real T2 = 2.0 * T; const Real exp_T = exp(-T); for (int m = mmax - 1; m >= 0; m–) Fm[m] = (Fm[m + 1] * T2 + exp_T) / (2 * m + 1); }


The documentation for this struct was generated from the following file: