UQTk: Uncertainty Quantification Toolkit 3.1.5
|
Generates quadrature rules. More...
#include <quad.h>
Classes | |
struct | QuadRule |
Rule structure that stores quadrature points, weights and indices. More... | |
Public Member Functions | |
Quad (char *grid_type, char *fs_type, int ndim, int param, double alpha=0.0, double betta=1.0) | |
Constructor: initializes the rule type, sparseness type, dimensionality, level or ppd parameter, and two optional parameters for quadrature rule. | |
Quad (Array1D< string > &grid_types, char *fs_type, Array1D< int > ¶m, Array1D< double > &alphas, Array1D< double > &bettas) | |
Constructor, overloaded for dimension-unisotropy: initializes the dimension-specific rule types, sparseness type, dimension-specific ppd or level, and two optional parameters for quadrature rule per each dimension. | |
Quad () | |
Constructor: empty. | |
~Quad () | |
Destructor. | |
void | init () |
Initialization function. | |
void | SetAlpha (double alpha) |
Set the parameter alpha. | |
void | SetBeta (double betta) |
Set the parameter beta. | |
void | SetDomain (Array1D< double > &aa, Array1D< double > &bb) |
Set the domain endpoints (for compact support domains) | |
void | SetDomain (Array1D< double > &aa) |
Set the domain endpoint (for semi-infinite domains) | |
void | GetDomain (Array1D< double > &aa, Array1D< double > &bb) const |
Get the domain endpoints (for compact support domains) | |
void | GetDomain (Array1D< double > &aa) const |
Get the domain endpoint (for semi-infinite domains) | |
void | SetRule (Array2D< double > &q, Array1D< double > &w) |
Set the rule externally (only quadrature points and weights) | |
void | SetRule (Array2D< double > &q, Array1D< double > &w, Array2D< int > &ind) |
Set the rule externally (quadrature points, weights and indices) Dummy function for backward compatibility. | |
void | SetRule () |
Set the rule externally (quadrature points, weights, indices, and the level) | |
void | GetRule (Array2D< double > &q, Array1D< double > &w) |
Get the quadrature rule. | |
void | GetRule (Array2D< double > &q, Array1D< double > &w, Array2D< int > &ind) |
Get the quadrature rule with indexing Dummy function for backward compatibility. | |
void | SetQdpts (Array2D< double > &q) |
Externally set quadrature points. | |
void | SetWghts (Array1D< double > &w) |
Externally set the weights. | |
void | GetQdpts (Array2D< double > &q) |
Externally set the indices. | |
void | GetWghts (Array1D< double > &w) |
Get the weights. | |
void | SetLevel (int param) |
Get the indices. | |
void | nextLevel () |
Compute the indices of the next-level points. | |
int | GetNQ () |
Get the number of quadrature points. | |
void | SetVerbosity (int verbosity) |
Set the verbosity level. | |
Private Member Functions | |
Quad (const Quad &) | |
Dummy copy constructor, which should not be used as it is currently not well defined. | |
void | MultiplyTwoRules (QuadRule *rule1, QuadRule *rule2, QuadRule *rule_prod) |
Multiply two rules (full tensor product) | |
void | MultiplyManyRules (int nrules, QuadRule *rules, QuadRule *rule_prod) |
Multiply many rules (full tensor product) | |
void | MultiplyManyRules_ (int nrules, QuadRule *rules, QuadRule *rule_prod) |
void | AddTwoRules (QuadRule *rule1, QuadRule *rule2, QuadRule *rule_sum) |
Add two rules. | |
void | SubtractTwoRules (QuadRule *rule1, QuadRule *rule2, QuadRule *rule_sum) |
Subtract two rules. | |
void | create1DRule (string gridtype, Array1D< double > &qdpts, Array1D< double > &wghts, int ngr, double a, double b) |
Compute 1D rules. | |
void | create1DRule_CC (Array1D< double > &qdpts, Array1D< double > &wghts, int ngr, double a, double b) |
Clenshaw-Curtis (includes the endpoints) | |
void | create1DRule_LU (Array1D< double > &qdpts, Array1D< double > &wghts, int ngr, double a, double b) |
Legendre-Uniform. | |
void | create1DRule_HG (Array1D< double > &qdpts, Array1D< double > &wghts, int ngr) |
Gauss-Hermite. | |
void | create1DRule_NC (Array1D< double > &qdpts, Array1D< double > &wghts, int ngr, double a, double b) |
Newton-Cotes (i.e. equispaced, includes the endpoints) | |
void | create1DRule_NCO (Array1D< double > &qdpts, Array1D< double > &wghts, int ngr, double a, double b) |
Newton-Cotes open (i.e. excludes the endpoints) | |
void | create1DRule_CCO (Array1D< double > &qdpts, Array1D< double > &wghts, int ngr, double a, double b) |
Clenshaw-Curtis open (i.e. excludes the endpoints) | |
void | create1DRule_JB (Array1D< double > &qdpts, Array1D< double > &wghts, int ngr, double a, double b) |
Jacobi-Beta. | |
void | create1DRule_LG (Array1D< double > &qdpts, Array1D< double > &wghts, int ngr) |
Gamma-Laguerre. | |
void | create1DRule_SW (Array1D< double > &qdpts, Array1D< double > &wghts, int ngr) |
Stieltjes-Wigert. | |
void | create1DRule_pdf (Array1D< double > &qdpts, Array1D< double > &wghts, int ngr, double a, double b) |
Custom rule given the recursive coefficients of the corresponding orthogonal polynomials. | |
void | create1DRule_GP3 (Array1D< double > &qdpts, Array1D< double > &wghts, int ngr, double a, double b) |
Gauss-Patterson starting with Legendre-Uniform 3. | |
void | getMultiIndexLevel (Array2D< int > &multiIndexLevel, int level, int ndim) |
Auxilliary function: get the level of the multi-index. | |
void | compressRule (QuadRule *rule) |
Compress the rule, i.e. merge repeating points. | |
Private Attributes | |
Array1D< double > | aa_ |
The left endpoints of the domain. | |
Array1D< double > | bb_ |
the right endpoints of the domain | |
int | quadverbose_ |
Verbosity level. | |
double | alpha_ |
The first parameter of the rule, if any. | |
double | beta_ |
The second parameter of the rule, if any. | |
Array1D< double > | alphas_ |
The first parameter of the rule, if any. | |
Array1D< double > | betas_ |
The second parameter of the rule, if any. | |
QuadRule | rule_ |
The quadrature rule structure. | |
int | ndim_ |
The dimensionality. | |
int | nlevel_ |
The current level, working variable for hierarchical construction. | |
int | maxlevel_ |
The level for sparse rules, or the number of grid points per dim for full product rules. | |
Array1D< int > | param_ |
Array2D< int > | npts_all |
Working arrays. | |
Array2D< int > | npts_1_all |
Array2D< QuadRule > | qr_all |
Array2D< QuadRule > | qr_1_all |
int | growth_rule_ |
Growth rule: exponential(0) or linear(1) | |
Array1D< int > | growth_rules_ |
Growth rules: exponential(0) or linear(1) | |
string | grid_type_ |
Grid type: 'CC','CCO','NC','NCO','LU', 'HG', 'JB', 'LG', 'SW', 'pdf', or 'GP3'. | |
Array1D< string > | grid_types_ |
Vector of grid types: 'CC','CCO','NC','NCO','LU', 'HG', 'JB', 'LG', 'SW', 'pdf', or 'GP3'. | |
string | fs_type_ |
Sparseness type (full or sparse) | |
Generates quadrature rules.
Quad::Quad | ( | char * | grid_type, |
char * | fs_type, | ||
int | ndim, | ||
int | param, | ||
double | alpha = 0.0, | ||
double | betta = 1.0 ) |
Constructor: initializes the rule type, sparseness type, dimensionality, level or ppd parameter, and two optional parameters for quadrature rule.
Quad::Quad | ( | Array1D< string > & | grid_types, |
char * | fs_type, | ||
Array1D< int > & | param, | ||
Array1D< double > & | alphas, | ||
Array1D< double > & | bettas ) |
Constructor, overloaded for dimension-unisotropy: initializes the dimension-specific rule types, sparseness type, dimension-specific ppd or level, and two optional parameters for quadrature rule per each dimension.
|
inline |
Constructor: empty.
|
inline |
Destructor.
|
inlineprivate |
Dummy copy constructor, which should not be used as it is currently not well defined.
Add two rules.
|
private |
Compress the rule, i.e. merge repeating points.
|
private |
Compute 1D rules.
|
private |
Clenshaw-Curtis (includes the endpoints)
|
private |
Clenshaw-Curtis open (i.e. excludes the endpoints)
|
private |
Gauss-Patterson starting with Legendre-Uniform 3.
|
private |
Gauss-Hermite.
|
private |
Jacobi-Beta.
|
private |
Gamma-Laguerre.
|
private |
Legendre-Uniform.
|
private |
Newton-Cotes (i.e. equispaced, includes the endpoints)
|
private |
Newton-Cotes open (i.e. excludes the endpoints)
|
private |
Custom rule given the recursive coefficients of the corresponding orthogonal polynomials.
|
private |
Stieltjes-Wigert.
|
inline |
Get the domain endpoint (for semi-infinite domains)
Get the domain endpoints (for compact support domains)
|
private |
Auxilliary function: get the level of the multi-index.
|
inline |
Get the number of quadrature points.
|
inline |
Externally set the indices.
Get quadrature points
Get the quadrature rule with indexing Dummy function for backward compatibility.
|
inline |
Get the weights.
void Quad::init | ( | ) |
Initialization function.
Multiply many rules (full tensor product)
Multiply two rules (full tensor product)
void Quad::nextLevel | ( | ) |
Compute the indices of the next-level points.
|
inline |
Set the parameter alpha.
|
inline |
Set the parameter beta.
void Quad::SetDomain | ( | Array1D< double > & | aa | ) |
Set the domain endpoint (for semi-infinite domains)
Set the domain endpoints (for compact support domains)
|
inline |
Get the indices.
Set the level parameter
|
inline |
Externally set quadrature points.
void Quad::SetRule | ( | ) |
Set the rule externally (quadrature points, weights, indices, and the level)
Set the rule (the function that builds quadrature points/weights/indices)
Set the rule externally (only quadrature points and weights)
Set the rule externally (quadrature points, weights and indices) Dummy function for backward compatibility.
|
inline |
Set the verbosity level.
|
inline |
Externally set the weights.
Subtract two rules.
|
private |
The left endpoints of the domain.
|
private |
The first parameter of the rule, if any.
|
private |
The first parameter of the rule, if any.
|
private |
the right endpoints of the domain
|
private |
The second parameter of the rule, if any.
|
private |
The second parameter of the rule, if any.
|
private |
Sparseness type (full or sparse)
|
private |
Grid type: 'CC','CCO','NC','NCO','LU', 'HG', 'JB', 'LG', 'SW', 'pdf', or 'GP3'.
|
private |
Vector of grid types: 'CC','CCO','NC','NCO','LU', 'HG', 'JB', 'LG', 'SW', 'pdf', or 'GP3'.
|
private |
Growth rule: exponential(0) or linear(1)
|
private |
Growth rules: exponential(0) or linear(1)
|
private |
The level for sparse rules, or the number of grid points per dim for full product rules.
|
private |
The dimensionality.
|
private |
The current level, working variable for hierarchical construction.
|
private |
|
private |
Working arrays.
|
private |
|
private |
Verbosity level.
|
private |
The quadrature rule structure.