59 template <
class ScalarType>
62 return 1.0/(z*z + 1.0);
88 Array< RCP<const OneDOrthogPolyBasis<int,double> > > bases(d);
89 for (
int i=0; i<d; i++) {
90 bases[i] =
rcp(
new HermiteBasis<int,double>(p));
92 RCP<const CompletePolynomialBasis<int,double> > basis =
93 rcp(
new CompletePolynomialBasis<int,double>(bases));
96 RCP<const Quadrature<int,double> > quad =
97 rcp(
new TensorProductQuadrature<int,double>(basis));
100 RCP<Sparse3Tensor<int,double> > Cijk =
101 basis->computeTripleProductTensor();
104 RCP<QuadOrthogPolyExpansion<int,double> > expn =
105 rcp(
new QuadOrthogPolyExpansion<int,double>(basis, Cijk, quad));
118 std::cout <<
"\tu = ";
120 std::cout <<
"\tv = ";
124 double mean = v.mean();
125 double std_dev = v.standard_deviation();
129 for (
int i=0; i<d; i++)
131 double up = u.evaluate(pt);
133 double vp2 = v.evaluate(pt);
136 std::cout <<
"\tv mean = " << mean << std::endl;
137 std::cout <<
"\tv std. dev. = " << std_dev << std::endl;
138 std::cout <<
"\tv(0.25) (true) = " << vp << std::endl;
139 std::cout <<
"\tv(0.25) (pce) = " << vp2 << std::endl;
141 catch (std::exception& e) {
142 std::cout << e.what() << std::endl;
ScalarType simple_function(const ScalarType &u)
Stokhos::StandardStorage< int, double > storage_type
Hermite polynomial basis.
Sacado::ETPCE::OrthogPoly< double, Stokhos::StandardStorage< int, double > > pce_type
Data structure storing a sparse 3-tensor C(i,j,k) in a a compressed format.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Abstract base class for quadrature methods.
Multivariate orthogonal polynomial basis generated from a total-order complete-polynomial tensor prod...
int main(int argc, char **argv)
Abstract base class for 1-D orthogonal polynomials.
Orthogonal polynomial expansions based on numerical quadrature.
KOKKOS_INLINE_FUNCTION PCE< Storage > log(const PCE< Storage > &a)
Defines quadrature for a tensor product basis by tensor products of 1-D quadrature rules...