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