npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::GaussHermiteQuadrature Class Reference

#include <GaussHermiteQuadrature.hh>

Public Types

enum  { interval_quadrature = 0 }
 

Public Member Functions

 GaussHermiteQuadrature (unsigned npoints)
 
unsigned npoints () const
 
void getAbscissae (long double *abscissae, unsigned len) const
 
void getAllAbscissae (long double *abscissae, unsigned len) const
 
void getWeights (long double *weights, unsigned len) const
 
void getAllWeights (long double *weights, unsigned len) const
 
template<typename FcnResult , typename FcnArg >
long double integrate (const Functor1< FcnResult, FcnArg > &fcn) const
 
template<typename FcnResult , typename FcnArg >
long double integrateProb (long double mean, long double sigma, const Functor1< FcnResult, FcnArg > &fcn) const
 

Static Public Member Functions

static bool isAllowed (unsigned npoints)
 
static std::vector< unsigned > allowedNPonts ()
 
static unsigned minimalExactRule (unsigned polyDegree)
 

Detailed Description

Gauss-Hermite quadrature. Internally, operations are performed in long double precision.

Constructor & Destructor Documentation

◆ GaussHermiteQuadrature()

npstat::GaussHermiteQuadrature::GaussHermiteQuadrature ( unsigned  npoints)
explicit

At the moment, the following numbers of points are supported: 16, 32, 64, 100, 128, 256, 512.

If an unsupported number of points is given in the constructor, std::invalid_argument exception will be thrown.

Note that, for the quadrature with 512 points, the arguments become as large as 31.4 and the weights become as small as 4.9e-430. Use of such weights with doubles is rather meaningless. Long double integrands are needed.

Member Function Documentation

◆ allowedNPonts()

static std::vector<unsigned> npstat::GaussHermiteQuadrature::allowedNPonts ( )
static

The complete set of allowed rules, in the increasing order

◆ getAbscissae()

void npstat::GaussHermiteQuadrature::getAbscissae ( long double *  abscissae,
unsigned  len 
) const

The abscissae are returned for positive points only, so the buffer length should be at least npoints/2.

◆ getAllAbscissae()

void npstat::GaussHermiteQuadrature::getAllAbscissae ( long double *  abscissae,
unsigned  len 
) const

Return abscissae for all points

◆ getAllWeights()

void npstat::GaussHermiteQuadrature::getAllWeights ( long double *  weights,
unsigned  len 
) const

Return weights for all points

◆ getWeights()

void npstat::GaussHermiteQuadrature::getWeights ( long double *  weights,
unsigned  len 
) const

The weights are returned for positive points only, so the buffer length should be at least npoints/2.

◆ integrate()

template<typename FcnResult , typename FcnArg >
long double npstat::GaussHermiteQuadrature::integrate ( const Functor1< FcnResult, FcnArg > &  fcn) const

Perform the quadrature

◆ integrateProb()

template<typename FcnResult , typename FcnArg >
long double npstat::GaussHermiteQuadrature::integrateProb ( long double  mean,
long double  sigma,
const Functor1< FcnResult, FcnArg > &  fcn 
) const

Perform the quadrature with Gaussian density weight

◆ isAllowed()

static bool npstat::GaussHermiteQuadrature::isAllowed ( unsigned  npoints)
static

Check if the rule with the given number of points is supported

◆ minimalExactRule()

static unsigned npstat::GaussHermiteQuadrature::minimalExactRule ( unsigned  polyDegree)
static

Minimum number of points, among the supported rules, which integrates a polynomial with the given degree exactly (with the appropriate weight). Returns 0 if the degree is out of range.

◆ npoints()

unsigned npstat::GaussHermiteQuadrature::npoints ( ) const
inline

Return the number of quadrature points


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