61 #include "HermiteOrthogPolynomial.hpp"
71 for (
int i=0; i<d; i++) {
72 bases[i] =
Teuchos::rcp(
new Stokhos::PecosOneDOrthogPolyBasis<int,double>(
Teuchos::rcp(
new Pecos::HermiteOrthogPolynomial),
"Hermite", p));
83 basis->computeTripleProductTensor();
91 for (
int i=0; i<d; i++) {
92 u.term(i,1) = 0.4 / d;
93 u.term(i,2) = 0.06 / d;
94 u.term(i,3) = 0.002 / d;
105 std::cout <<
"v = 1.0 / (log(u)^2 + 1):" << std::endl;
106 std::cout <<
"\tu = ";
108 std::cout <<
"\tv = ";
112 double mean = v.mean();
113 double std_dev = v.standard_deviation();
117 for (
int i=0; i<d; i++)
119 double up = u.evaluate(pt);
121 double vp2 = v.evaluate(pt);
124 std::cout <<
"\tv mean = " << mean << std::endl;
125 std::cout <<
"\tv std. dev. = " << std_dev << std::endl;
126 std::cout <<
"\tv(0.25) (true) = " << vp << std::endl;
127 std::cout <<
"\tv(0.25) (pce) = " << vp2 << std::endl;
131 std::cout <<
"\nExample Passed!" << std::endl;
133 catch (std::exception& e) {
134 std::cout << e.what() << std::endl;
void times(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
void plusEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
void divide(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
KOKKOS_INLINE_FUNCTION PCE< Storage > abs(const PCE< Storage > &a)
void log(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
int main(int argc, char **argv)
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...