59 const double mean = 0.2;
60 const double std_dev = 0.1;
62 for (
int i=0; i<d; i++) {
74 basis->computeTripleProductTensor();
82 for (
int i=0; i<d; i++)
83 u.term(i,1) = std_dev / (i+1);
90 for (
int j=0;
j<d;
j++)
91 w_mean += u.term(
j,1)*u.term(
j,1)/2.0;
93 for (
int i=0; i<basis->size(); i++) {
96 for (
int j=0;
j<d;
j++)
98 w[i] = w_mean*s/basis->norm_squared(i);
105 #ifdef HAVE_STOKHOS_DAKOTA
110 const double mean = 0.2;
111 const double std_dev = 0.1;
113 for (
int i=0; i<d; i++) {
121 Teuchos::rcp(
new Stokhos::SparseGridQuadrature<int,double>(basis, p));
125 basis->computeTripleProductTensor();
133 for (
int i=0; i<d; i++)
134 u.term(i,1) = std_dev / (i+1);
140 double w_mean = mean;
141 for (
int j=0;
j<d;
j++)
142 w_mean += u.term(
j,1)*u.term(
j,1)/2.0;
144 for (
int i=0; i<basis->size(); i++) {
147 for (
int j=0;
j<d;
j++)
149 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...