UQTk: Uncertainty Quantification Toolkit 3.1.5
gkpclib.cpp File Reference
#include "math.h"
#include "tools.h"
#include "gkplib.h"

Macros

#define MAX(a, b)
 

Functions

void getCC (int n, int *nq, double **x, double **w)
 retrieve pointers to 1D Clenshaw-Curtis rules
 
void getGKPunif (int n, int *nq, double **x, double **w)
 retrieve pointers to 1D Gauss-Kronrod-Patterson rules for uniform pdf based on the quadrature level
 
void getGKPnorm (int n, int *nq, double **x, double **w)
 retrieve pointers to 1D Kronrod-Patterson rules for normal pdf based on the quadrature level
 
int getOrderCC (int lev)
 get order of Clenshaw-Curtis rules based on level
 
int getOrderGKPunif (int lev)
 get order of uniform Gauss-Kronrod-Patterson rules based on level
 
int getOrderGKPnorm (int lev)
 get order of normal Gauss-Kronrod-Patterson rules based on level
 
void getCompNintoDim (int n, int dim, int *nelem, int **plist)
 List of decompositions of 'n' into 'dim' parts. The implementation is based on Algorithm 5 of Combinatorial Algorithms by Albert Nijenhuis, Herbert Wilf.
 
int getSpgSize (int getOrder(int), int dim, int lev)
 Initial estimate for sparse grid size.
 
void getSpgQW (void get1DQW(int, int *, double **, double **), int getOrder(int), int dim, int lev, int *nqpts, double **qpts, double **w)
 Main function that connects the user setup for pdftype, dimensionality, and quadrature level and various pieces of the sparse quadrature algorithm employing Gauss-Kronrod-Patterson rules.
 
void getSpgAnisQW (void get1DQW(int, int *, double **, double **), int getOrder(int), int dim, int *levList, int *nqpts, double **qpts, double **w)
 
void sortSpg (int dim, int spgSize, double *qpts, double *w)
 Sort sparse grid in lexicographical order.
 
void getTensorProd (int dim, double *qpts, double *w, int *spgSize, int *n1D, double **x1D, double **w1D, double qfac)
 compute dim-dimensional tensor grid based a series of 1D rules
 

Variables

static double x1 [] = {0.0000000}
 
static double w1 [] = {2.0000000}
 
static double x3 [] = {-0.77459666924148337704,0.0, 0.77459666924148337704 }
 
static double w3 [] = {0.555555555555555555556,0.888888888888888888889,0.555555555555555555556}
 
static double x7 []
 
static double w7 []
 
static double x15 []
 
static double w15 []
 
static double x31 []
 
static double w31 []
 
static double x63 []
 
static double w63 []
 
static double xn1 [] = {0.0000000000000000}
 
static double wn1 [] = {1.0000000000000000}
 
static double xn3 [] = {-1.73205080756887719, 0.000000000000000000, 1.73205080756887719}
 
static double wn3 [] = {0.166666666666666657, 0.66666666666666663, 0.166666666666666657}
 
static double xn9 []
 
static double wn9 []
 
static double xn19 []
 
static double wn19 []
 
static double xn35 []
 
static double wn35 []
 

Macro Definition Documentation

◆ MAX

#define MAX ( a,
b )
Value:
(((a) > (b)) ? (a) : (b))

Function Documentation

◆ getCC()

void getCC ( int n,
int * nq,
double ** x,
double ** w )

retrieve pointers to 1D Clenshaw-Curtis rules

◆ getCompNintoDim()

void getCompNintoDim ( int n,
int dim,
int * nelem,
int ** plist )

List of decompositions of 'n' into 'dim' parts. The implementation is based on Algorithm 5 of Combinatorial Algorithms by Albert Nijenhuis, Herbert Wilf.

◆ getGKPnorm()

void getGKPnorm ( int n,
int * nq,
double ** x,
double ** w )

retrieve pointers to 1D Kronrod-Patterson rules for normal pdf based on the quadrature level

◆ getGKPunif()

void getGKPunif ( int n,
int * nq,
double ** x,
double ** w )

retrieve pointers to 1D Gauss-Kronrod-Patterson rules for uniform pdf based on the quadrature level

◆ getOrderCC()

int getOrderCC ( int lev)

get order of Clenshaw-Curtis rules based on level

◆ getOrderGKPnorm()

int getOrderGKPnorm ( int lev)

get order of normal Gauss-Kronrod-Patterson rules based on level

◆ getOrderGKPunif()

int getOrderGKPunif ( int lev)

get order of uniform Gauss-Kronrod-Patterson rules based on level

◆ getSpgAnisQW()

void getSpgAnisQW ( void get1DQWint, int *, double **, double **,
int getOrderint,
int dim,
int * levList,
int * nqpts,
double ** qpts,
double ** w )

◆ getSpgQW()

void getSpgQW ( void get1DQWint, int *, double **, double **,
int getOrderint,
int dim,
int lev,
int * nqpts,
double ** qpts,
double ** w )

Main function that connects the user setup for pdftype, dimensionality, and quadrature level and various pieces of the sparse quadrature algorithm employing Gauss-Kronrod-Patterson rules.

◆ getSpgSize()

int getSpgSize ( int getOrderint,
int dim,
int lev )

Initial estimate for sparse grid size.

◆ getTensorProd()

void getTensorProd ( int dim,
double * qpts,
double * w,
int * spgSize,
int * n1D,
double ** x1D,
double ** w1D,
double qfac )

compute dim-dimensional tensor grid based a series of 1D rules

◆ sortSpg()

void sortSpg ( int dim,
int spgSize,
double * qpts,
double * w )

Sort sparse grid in lexicographical order.

Variable Documentation

◆ w1

double w1[] = {2.0000000}
static

◆ w15

double w15[]
static
Initial value:
= {0.0170017196299402603390,0.0516032829970797396969,0.0929271953151245376859,
0.134415255243784220360, 0.171511909136391380787, 0.200628529376989021034,
0.219156858401587496404, 0.225510499798206687386, 0.219156858401587496404,
0.200628529376989021034, 0.171511909136391380787, 0.134415255243784220360,
0.0929271953151245376859,0.0516032829970797396969, 0.0170017196299402603390}

◆ w3

double w3[] = {0.555555555555555555556,0.888888888888888888889,0.555555555555555555556}
static

◆ w31

double w31[]
static
Initial value:
= {0.00254478079156187441540,0.00843456573932110624631,0.0164460498543878109338,
0.0258075980961766535646, 0.0359571033071293220968, 0.0464628932617579865414,
0.0569795094941233574122, 0.0672077542959907035404, 0.0768796204990035310427,
0.0857559200499903511542, 0.0936271099812644736167, 0.100314278611795578771,
0.105669893580234809744, 0.109578421055924638237, 0.111956873020953456880,
0.112755256720768691607,
0.111956873020953456880, 0.109578421055924638237, 0.105669893580234809744,
0.100314278611795578771, 0.0936271099812644736167, 0.0857559200499903511542,
0.0768796204990035310427, 0.0672077542959907035404, 0.0569795094941233574122,
0.0464628932617579865414, 0.0359571033071293220968, 0.0258075980961766535646,
0.0164460498543878109338, 0.00843456573932110624631,0.00254478079156187441540 }

◆ w63

double w63[]
static
Initial value:
= {0.000363221481845530659694,0.00126515655623006801137,0.00257904979468568827243,
0.00421763044155885483908, 0.00611550682211724633968,0.00822300795723592966926,
0.0104982469096213218983, 0.0129038001003512656260, 0.0154067504665594978021,
0.0179785515681282703329, 0.0205942339159127111492, 0.0232314466399102694433,
0.0258696793272147469108, 0.0284897547458335486125, 0.0310735511116879648799,
0.0336038771482077305417, 0.0360644327807825726401, 0.0384398102494555320386,
0.0407155101169443189339, 0.0428779600250077344929, 0.0449145316536321974143,
0.0468135549906280124026, 0.0485643304066731987159, 0.0501571393058995374137,
0.0515832539520484587768, 0.0528349467901165198621, 0.0539054993352660639269,
0.0547892105279628650322, 0.0554814043565593639878, 0.0559784365104763194076,
0.0562776998312543012726, 0.0563776283603847173877, 0.0562776998312543012726,
0.0559784365104763194076, 0.0554814043565593639878, 0.0547892105279628650322,
0.0539054993352660639269, 0.0528349467901165198621, 0.0515832539520484587768,
0.0501571393058995374137, 0.0485643304066731987159, 0.0468135549906280124026,
0.0449145316536321974143, 0.0428779600250077344929, 0.0407155101169443189339,
0.0384398102494555320386, 0.0360644327807825726401, 0.0336038771482077305417,
0.0310735511116879648799, 0.0284897547458335486125, 0.0258696793272147469108,
0.0232314466399102694433, 0.0205942339159127111492, 0.0179785515681282703329,
0.0154067504665594978021, 0.0129038001003512656260, 0.0104982469096213218983,
0.00822300795723592966926, 0.00611550682211724633968,0.00421763044155885483908,
0.00257904979468568827243, 0.00126515655623006801137,0.000363221481845530659694 }

◆ w7

double w7[]
static
Initial value:
= { 0.104656226026467265194,0.268488089868333440729,0.401397414775962222905,
0.450916538658474142345,
0.401397414775962222905,0.268488089868333440729,0.104656226026467265194}

◆ wn1

double wn1[] = {1.0000000000000000}
static

◆ wn19

double wn19[]
static
Initial value:
= { 8.62968460222986318E-10, 6.09480873146898402E-07, 6.01233694598479965E-05,
0.00288488043650675591, -0.00633722479337375712, 0.0180852342547984622,
0.0640960546868076103, 0.0611517301252477163, 0.208324991649608771,
0.303467199854206227,
0.208324991649608771, 0.0611517301252477163, 0.0640960546868076103,
0.0180852342547984622, -0.00633722479337375712, 0.00288488043650675591,
6.01233694598479965E-05, 6.09480873146898402E-07,8.62968460222986318E-10 }

◆ wn3

double wn3[] = {0.166666666666666657, 0.66666666666666663, 0.166666666666666657}
static

◆ wn35

double wn35[]
static
Initial value:
= { 1.05413265823340136E-18, 5.45004126506381281E-15, 3.09722235760629949E-12,
4.60117603486559168E-10, 2.13941944795610622E-08, 2.46764213457981401E-07,
2.73422068011878881E-06, 3.57293481989753322E-05, 0.000275242141167851312,
0.000818953927502267349, 0.00231134524035220713, 0.00315544626918755127,
0.015673473751851151, 0.0452736854651503914, 0.0923647267169863534,
0.148070831155215854, 0.191760115888044341,
0.000514894508069213769,
0.191760115888044341, 0.148070831155215854,
0.0923647267169863534, 0.0452736854651503914, 0.015673473751851151,
0.00315544626918755127, 0.00231134524035220713, 0.000818953927502267349,
0.000275242141167851312, 3.57293481989753322E-05, 2.73422068011878881E-06,
2.46764213457981401E-07, 2.13941944795610622E-08, 4.60117603486559168E-10,
3.09722235760629949E-12, 5.45004126506381281E-15, 1.05413265823340136E-18 }

◆ wn9

double wn9[]
static
Initial value:
= { 9.42694575565174701E-05, 0.00799632547089352934, 0.0948509485094851251,
0.270074329577937755, 0.253968253968254065, 0.270074329577937755,
0.0948509485094851251,0.00799632547089352934,9.42694575565174701E-05 }

◆ x1

double x1[] = {0.0000000}
static

◆ x15

double x15[]
static
Initial value:
= {-0.99383196321275502221,-0.96049126870802028342,-0.88845923287225699889,
-0.77459666924148337704,-0.62110294673722640294,-0.43424374934680255800,
-0.22338668642896688163, 0.0, 0.22338668642896688163,
0.43424374934680255800, 0.62110294673722640294, 0.77459666924148337704,
0.88845923287225699889, 0.96049126870802028342, 0.99383196321275502221 }

◆ x3

double x3[] = {-0.77459666924148337704,0.0, 0.77459666924148337704 }
static

◆ x31

double x31[]
static
Initial value:
= {-0.99909812496766759766,-0.99383196321275502221,-0.98153114955374010687,
-0.96049126870802028342,-0.92965485742974005667,-0.88845923287225699889,
-0.83672593816886873550,-0.77459666924148337704,-0.70249620649152707861,
-0.62110294673722640294,-0.53131974364437562397,-0.43424374934680255800,
-0.33113539325797683309,-0.22338668642896688163,-0.11248894313318662575,
0.0,
0.11248894313318662575, 0.22338668642896688163, 0.33113539325797683309,
0.43424374934680255800, 0.53131974364437562397, 0.62110294673722640294,
0.70249620649152707861, 0.77459666924148337704, 0.83672593816886873550,
0.88845923287225699889, 0.92965485742974005667, 0.96049126870802028342,
0.98153114955374010687, 0.99383196321275502221, 0.99909812496766759766 }

◆ x63

double x63[]
static
Initial value:
= {-0.99987288812035761194,-0.99909812496766759766,-0.99720625937222195908,
-0.99383196321275502221,-0.98868475754742947994,-0.98153114955374010687,
-0.97218287474858179658,-0.96049126870802028342,-0.94634285837340290515,
-0.92965485742974005667,-0.91037115695700429250,-0.88845923287225699889,
-0.86390793819369047715,-0.83672593816886873550,-0.80694053195021761186,
-0.77459666924148337704,-0.73975604435269475868,-0.70249620649152707861,
-0.66290966002478059546,-0.62110294673722640294,-0.57719571005204581484,
-0.53131974364437562397,-0.48361802694584102756,-0.43424374934680255800,
-0.38335932419873034692,-0.33113539325797683309,-0.27774982202182431507,
-0.22338668642896688163,-0.16823525155220746498,-0.11248894313318662575,
-0.056344313046592789972,0.0, 0.056344313046592789972,
0.11248894313318662575, 0.16823525155220746498, 0.22338668642896688163,
0.27774982202182431507, 0.33113539325797683309, 0.38335932419873034692,
0.43424374934680255800, 0.48361802694584102756, 0.53131974364437562397,
0.57719571005204581484, 0.62110294673722640294, 0.66290966002478059546,
0.70249620649152707861, 0.73975604435269475868, 0.77459666924148337704,
0.80694053195021761186, 0.83672593816886873550, 0.86390793819369047715,
0.88845923287225699889, 0.91037115695700429250, 0.92965485742974005667,
0.94634285837340290515, 0.96049126870802028342, 0.97218287474858179658,
0.98153114955374010687, 0.98868475754742947994, 0.99383196321275502221,
0.99720625937222195908, 0.99909812496766759766, 0.99987288812035761194 }

◆ x7

double x7[]
static
Initial value:
= {-0.96049126870802028342,-0.77459666924148337704,-0.43424374934680255800,
0.0,
0.43424374934680255800, 0.77459666924148337704, 0.96049126870802028342}

◆ xn1

double xn1[] = {0.0000000000000000}
static

◆ xn19

double xn19[]
static
Initial value:
= {-6.36339449433636961, -5.18701603991365623, -4.18495601767273229,
-3.20533379449919442, -2.86127957605705818, -2.59608311504920231,
-1.73205080756887719, -1.23042363402730603, -0.741095349994540853,
0.0000000000000000,
0.741095349994540853, 1.23042363402730603, 1.73205080756887719,
2.59608311504920231, 2.86127957605705818, 3.20533379449919442,
4.18495601767273229, 5.18701603991365623, 6.36339449433636961 }

◆ xn3

double xn3[] = {-1.73205080756887719, 0.000000000000000000, 1.73205080756887719}
static

◆ xn35

double xn35[]
static
Initial value:
= {-9.0169397898903032, -7.98077179859056063, -7.12210670080461661,
-6.36339449433636961, -5.69817776848810986, -5.18701603991365623,
-4.73643308595229673, -4.18495601767273229, -3.63531851903727832,
-3.20533379449919442, -2.86127957605705818, -2.59608311504920231,
-2.23362606167694189, -1.73205080756887719, -1.23042363402730603,
-0.741095349994540853, -0.248992297579960609,
0.00000000000000000,
0.248992297579960609, 0.741095349994540853,
1.23042363402730603, 1.73205080756887719, 2.23362606167694189,
2.59608311504920231, 2.86127957605705818, 3.20533379449919442,
3.63531851903727832, 4.18495601767273229, 4.73643308595229673,
5.18701603991365623, 5.69817776848810986, 6.36339449433636961,
7.12210670080461661, 7.98077179859056063, 9.0169397898903032 }

◆ xn9

double xn9[]
static
Initial value:
= {-4.18495601767273229, -2.86127957605705818, -1.73205080756887719,
-0.741095349994540853, 0.00000000000000000, 0.741095349994540853,
1.73205080756887719, 2.86127957605705818, 4.18495601767273229 }