SOFUS ..
Classes | Functions | Variables
gl Namespace Reference

Gauss-Legendre interfaces and implementations. More...

Classes

struct  GLNode
 Container for weight and nodes. More...
 

Functions

double GLQuad (size_t n, double(*f)(double, void *), void *data, double a, double b)
 
gl::GLNode GL (size_t l, size_t k)
 
gl::GLNode GLS (size_t n, size_t k)
 
double besseljzero (int k)
 
double besselj1squared (int k)
 

Variables

const double * weights [_GL_LUT_TABLE_SIZE]
 Weight used for Gauss-Legendre integration. More...
 
const double * abcissas [_GL_LUT_TABLE_SIZE]
 Abcissae or coordinates used for Gauss-Legendre integration. More...
 

Detailed Description

Gauss-Legendre interfaces and implementations.

Function Documentation

◆ besselj1squared()

double besselj1squared ( int  k)

This function computes the square of BesselJ(1, BesselZero(0,k))

Parameters
k
Returns

◆ besseljzero()

double besseljzero ( int  k)

This function computes the k'th zero of the BesselJ(0,x)

Parameters
k
Returns

◆ GL()

gl::GLNode GL ( size_t  l,
size_t  k 
)

Purpose:

GL computes the kth GL pair of an n-point rule. It uses look-up tables for the n < 101.

Licensing:

This code is distributed under the BSD license.

Modified:

22 December 2015

Author:

Ignace Bogaert

Reference:

Ignace Bogaert, Iteration-free computation of Gauss-Legendre quadrature nodes and weights, SIAM Journal on Scientific Computing, Volume 36, Number 3, 2014, pages A1008-1026.

The only function that needs to be public

Parameters
lThe number of points in the given rule
kThe index of the point to be returned
Returns
The location and weight of the point

◆ GLQuad()

double GLQuad ( size_t  n,
double(*)(double, void *)  f,
void *  data,
double  a,
double  b 
)

Gauss-Legendre quadrature using an n-point rule.

Parameters
nQuadrature order
fIntegrand
dataPointer to user-defined data which will be passed to f every time it is called (as second parameter).
aLower integration limit
bUpper integration limit
Returns

◆ GLS()

gl::GLNode GLS ( size_t  n,
size_t  k 
)

GLS computes the kth GL pair of an n-point rule using the formula rather than look-up tables.

Reference:

Ignace Bogaert, Iteration-free computation of Gauss-Legendre quadrature nodes and weights, SIAM Journal on Scientific Computing, Volume 36, Number 3, 2014, pages A1008-1026.

Parameters
nThe number of points in the given rule
kThe index of the point to be returned
Returns

Variable Documentation

◆ abcissas

const double* abcissas[_GL_LUT_TABLE_SIZE]
extern

Abcissae or coordinates used for Gauss-Legendre integration.

◆ weights

const double* weights[_GL_LUT_TABLE_SIZE]
extern

Weight used for Gauss-Legendre integration.

Referenced by CalcFastFourAny(), CalcFastFourAny2(), and CalcFourFast().