UQTk: Uncertainty Quantification Toolkit  3.1.1
Macros | Functions
gq.cpp File Reference

Utilities to generate quadrature rules. More...

#include "stdio.h"
#include "stdlib.h"
#include <iostream>
#include <cmath>
#include "Array1D.h"
#include "Array2D.h"
#include "deplapack.h"
#include "gq.h"
#include "combin.h"

Macros

#define DPI   3.14159265358979323846
 

Functions

double lpol_gq (int n, double x)
 
double hpol_gq (int n, double x)
 
double hpol_phys_gq (int n, double x)
 
double jpol_gq (int n, double a, double b, double x)
 
double jpolp_gq (int n, double a, double b, double x)
 
double lgpol_gq (int n, double a, double x)
 
double fact_gq (int n)
 
void gq (const int kind, const double a, const double b, Array1D< double > &x, Array1D< double > &w)
 Computes abscissas and weights for several quadrature rules. More...
 
void gq (const int kind, const int n, const double a, const double b, double *x, double *w)
 Computes abscissas and weights for several quadrature rules. More...
 
void gchb (const int kind, const int n, double *x, double *w)
 Computes abscissas and weights for Chebyshev quadrature rules. More...
 
void gq_gen (Array1D< double > &a, Array1D< double > &b, const double amu0, Array1D< double > &x, Array1D< double > &w)
 Computes abscissas and weights for a generic orthogonal polynomial recursion using the Golub-Welsch algorithm. More...
 
void vandermonde_gq (Array1D< double > &x, Array1D< double > &w, Array1D< double > &q)
 Computes abscissas and weights for Newton-Cotes rules through the solution of a Vandermonde matrix. This function was tested as an internal function only, called by the quadrature class. More...
 

Detailed Description

Utilities to generate quadrature rules.

Macro Definition Documentation

◆ DPI

#define DPI   3.14159265358979323846

Function Documentation

◆ fact_gq()

double fact_gq ( int  n)

◆ gchb()

void gchb ( const int  kind,
const int  n,
double *  x,
double *  w 
)

Computes abscissas and weights for Chebyshev quadrature rules.

Parameters
kind: defines quadrature type (1) Gauss-Chebyshev 1st kind (2) Gauss-Chebyshev 2nd kind
n: quadrature order
x: on return it holds quadrature abscissas.
w: on return it holds quadrature weights.

◆ gq() [1/2]

void gq ( const int  kind,
const double  a,
const double  b,
Array1D< double > &  x,
Array1D< double > &  w 
)

Computes abscissas and weights for several quadrature rules.

Parameters
kind: defines quadrature type (1) Gauss-Legendre, (2) Gauss-Chebyshev 1st kind (3) Gauss-Chebyshev 2nd kind, (4) Gauss-Hermite, (5) Gauss-Jacobi (6) Gauss-Laguerre
a: optional parameter needed by Gauss-Jacobi and Gauss-Laguerre rules
b: optional parameter needed by Gauss-Jacobi rule
x: on return it holds quadrature abscissas. Its initial size determines the quadrature order
w: on return it holds quadrature weights.

◆ gq() [2/2]

void gq ( const int  kind,
const int  n,
const double  a,
const double  b,
double *  x,
double *  w 
)

Computes abscissas and weights for several quadrature rules.

Parameters
kind: defines quadrature type (1) Gauss-Legendre, (2) Gauss-Chebyshev 1st kind (3) Gauss-Chebyshev 2nd kind, (4) Gauss-Hermite, (5) Gauss-Jacobi (6) Gauss-Laguerre
n: quadrature order
a: optional parameter needed by Gauss-Jacobi and Gauss-Laguerre rules
b: optional parameter needed by Gauss-Jacobi rule
x: on return it holds quadrature abscissas.
w: on return it holds quadrature weights.

◆ gq_gen()

void gq_gen ( Array1D< double > &  a,
Array1D< double > &  b,
const double  amu0,
Array1D< double > &  x,
Array1D< double > &  w 
)

Computes abscissas and weights for a generic orthogonal polynomial recursion using the Golub-Welsch algorithm.

Parameters
a: array of parameters for the orthogonal polynomial recursion. Its initial size determines the quadrature order
b: array of parameters for the orthogonal polynomial recursion
amu0: parameter for custom scaling of quadrature weights
x: on return it holds quadrature abscissas
w: on return it holds quadrature weights.

◆ hpol_gq()

double hpol_gq ( int  n,
double  x 
)

◆ hpol_phys_gq()

double hpol_phys_gq ( int  n,
double  x 
)

◆ jpol_gq()

double jpol_gq ( int  n,
double  a,
double  b,
double  x 
)

◆ jpolp_gq()

double jpolp_gq ( int  n,
double  a,
double  b,
double  x 
)

◆ lgpol_gq()

double lgpol_gq ( int  n,
double  a,
double  x 
)

◆ lpol_gq()

double lpol_gq ( int  n,
double  x 
)

◆ vandermonde_gq()

void vandermonde_gq ( Array1D< double > &  x,
Array1D< double > &  w,
Array1D< double > &  q 
)

Computes abscissas and weights for Newton-Cotes rules through the solution of a Vandermonde matrix. This function was tested as an internal function only, called by the quadrature class.

Parameters
x: holds quadrature abscissas
w: on return it holds quadrature weights.
q: array of parameters needed to setup the Vandermonde matrix