27 #include "HermiteOrthogPolynomial.hpp"
37 for (
int i=0; i<d; i++) {
38 bases[i] =
Teuchos::rcp(
new Stokhos::PecosOneDOrthogPolyBasis<int,double>(
Teuchos::rcp(
new Pecos::HermiteOrthogPolynomial),
"Hermite", p));
49 basis->computeTripleProductTensor();
57 for (
int i=0; i<d; i++) {
58 u.term(i,1) = 0.4 / d;
59 u.term(i,2) = 0.06 / d;
60 u.term(i,3) = 0.002 / d;
71 std::cout <<
"v = 1.0 / (log(u)^2 + 1):" << std::endl;
72 std::cout <<
"\tu = ";
74 std::cout <<
"\tv = ";
78 double mean = v.mean();
79 double std_dev = v.standard_deviation();
83 for (
int i=0; i<d; i++)
85 double up = u.evaluate(pt);
87 double vp2 = v.evaluate(pt);
90 std::cout <<
"\tv mean = " << mean << std::endl;
91 std::cout <<
"\tv std. dev. = " << std_dev << std::endl;
92 std::cout <<
"\tv(0.25) (true) = " << vp << std::endl;
93 std::cout <<
"\tv(0.25) (pce) = " << vp2 << std::endl;
97 std::cout <<
"\nExample Passed!" << std::endl;
99 catch (std::exception& e) {
100 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...