25 const double mean = 0.2;
26 const double std_dev = 0.1;
28 for (
int i=0; i<d; i++) {
40 basis->computeTripleProductTensor();
48 for (
int i=0; i<d; i++)
49 u.term(i,1) = std_dev / (i+1);
56 for (
int j=0;
j<d;
j++)
57 w_mean += u.term(
j,1)*u.term(
j,1)/2.0;
59 for (
int i=0; i<basis->size(); i++) {
62 for (
int j=0;
j<d;
j++)
64 w[i] = w_mean*s/basis->norm_squared(i);
71 #ifdef HAVE_STOKHOS_DAKOTA
76 const double mean = 0.2;
77 const double std_dev = 0.1;
79 for (
int i=0; i<d; i++) {
87 Teuchos::rcp(
new Stokhos::SparseGridQuadrature<int,double>(basis, p));
91 basis->computeTripleProductTensor();
99 for (
int i=0; i<d; i++)
100 u.term(i,1) = std_dev / (i+1);
106 double w_mean = mean;
107 for (
int j=0;
j<d;
j++)
108 w_mean += u.term(
j,1)*u.term(
j,1)/2.0;
110 for (
int i=0; i<basis->size(); i++) {
113 for (
int j=0;
j<d;
j++)
115 w[i] = w_mean*s/basis->norm_squared(i);
Hermite polynomial basis.
void exp(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > pow(const PCE< Storage > &a, const PCE< Storage > &b)
bool comparePCEs(const PCEType &a1, const std::string &a1_name, const Stokhos::OrthogPolyApprox< OrdinalType, ValueType > &a2, const std::string &a2_name, const ValueType &rel_tol, const ValueType &abs_tol, Teuchos::FancyOStream &out)
A multidimensional index.
static int runUnitTestsFromMain(int argc, char *argv[])
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
KOKKOS_INLINE_FUNCTION PCE< Storage > exp(const PCE< Storage > &a)
int main(int argc, char **argv)
Defines quadrature for a tensor product basis by tensor products of 1-D quadrature rules...