H2Lib  3.0
Functions
gaussquad

Construction of one-dimensional quadrature rules. More...

Functions

void assemble_gauss (uint m, preal x, preal w)
 Construction of quadrature points and weights for Gaussian quadrature. More...
 

Detailed Description

Construction of one-dimensional quadrature rules.

Function Documentation

void assemble_gauss ( uint  m,
preal  x,
preal  w 
)

Construction of quadrature points and weights for Gaussian quadrature.

The quadrature points are the zeros of the $m$-th order Legendre polynomial. The Legendre polynomial can be expressed as the characteristic polynomial of a tridiagonal matrix, so its zeros can be computed by solving an eigenvalue problem. The quadrature weights can be obtained from the corresponding eigenvectors.

Parameters
mRequired number of quadrature points. The resulting quadrature rule will be exact for polynomials of order $2m-1$.
xShould be an array of size $m$, will be overwritten by the quadrature points in $[-1,1]$.
wShould be an array of size $m$, will be overwritten by the quadrature weights.