UQTk: Uncertainty Quantification Toolkit 3.1.5
|
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. | |
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. | |
void | gchb (const int kind, const int n, double *x, double *w) |
Computes abscissas and weights for Chebyshev quadrature rules. | |
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. | |
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. | |
Utilities to generate quadrature rules.
#define DPI 3.14159265358979323846 |
double fact_gq | ( | int | n | ) |
void gchb | ( | const int | kind, |
const int | n, | ||
double * | x, | ||
double * | w ) |
Computes abscissas and weights for Chebyshev quadrature rules.
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. |
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.
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. |
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.
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. |
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.
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. |
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 lpol_gq | ( | int | n, |
double | x ) |
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.
x | : holds quadrature abscissas |
w | : on return it holds quadrature weights. |
q | : array of parameters needed to setup the Vandermonde matrix |