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

#include <SemiInfGaussianQuadrature.hh>

Public Types

enum  { interval_quadrature = 0 }
 

Public Member Functions

 SemiInfGaussianQuadrature (unsigned npoints)
 
unsigned npoints () const
 
void getAllAbscissae (long double *abscissae, 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 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

Quadrature for functions of the type f(x) exp(-x^2/2) on [0, Infinity]

Constructor & Destructor Documentation

◆ SemiInfGaussianQuadrature()

npstat::SemiInfGaussianQuadrature::SemiInfGaussianQuadrature ( unsigned  npoints)
explicit

At the moment, the following numbers of points are supported: 4, 8, 16, 24, 32.

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

Member Function Documentation

◆ allowedNPonts()

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

The complete set of allowed rules, in the increasing order

◆ getAllAbscissae()

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

Get the abscissae for the integration points. The buffer length should be at least npoints.

◆ getAllWeights()

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

Get the weights for the integration points. The buffer length should be at least npoints.

◆ integrate()

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

Perform the quadrature

◆ integrateProb()

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

Perform the quadrature f(x) Sqrt[2/Pi]/sigma Exp[-(x/sigma)^2/2] (the weight is normalized to unit integral on [0, Infinity])

◆ isAllowed()

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

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

◆ minimalExactRule()

static unsigned npstat::SemiInfGaussianQuadrature::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::SemiInfGaussianQuadrature::npoints ( ) const
inline

Return the number of quadrature points


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