26 double operator() (
const double& a,
const double& b)
const {
40 const unsigned int d = 2;
41 const unsigned int p = 5;
45 for (
unsigned int i=0; i<d; i++)
52 w(basis), w2(basis), w3(basis);
53 for (
unsigned int i=0; i<d; i++) {
63 basis->computeTripleProductTensor();
71 quad_exp.
times(w,v,u);
85 u_st.term(0, 0) = u.mean();
86 u_st.term(0, 1) = 1.0;
87 v_st.term(0, 0) = v.mean();
88 v_st.term(1, 1) = 1.0;
94 st_bases[0]->getQuadPoints(p+1, st_points_0, st_weights_0, st_values_0);
98 st_bases[1]->getQuadPoints(p+1, st_points_1, st_weights_1, st_values_1);
100 for (
int i=0; i<st_points_0.
size(); i++) {
102 st_points[i][0] = st_points_0[i];
103 st_points[i][1] = st_points_1[i];
126 gs_basis->computeTripleProductTensor();
137 gs_basis->transformCoeffs(u_st.coeff(), u_gs.coeff());
138 gs_basis->transformCoeffs(v_st.coeff(), v_gs.coeff());
141 gs_quad_exp.
times(w_gs, u_gs, v_gs);
149 st_basis->computeTripleProductTensor();
161 st_quad_exp.
times(w_st, u_st, v_st);
167 std::cout.precision(12);
168 std::cout <<
"w = " << std::endl << w;
169 std::cout <<
"w2 = " << std::endl << w2;
170 std::cout <<
"w3 = " << std::endl << w3;
171 std::cout <<
"w_gs = " << std::endl << w_gs;
172 std::cout <<
"w_st = " << std::endl << w_st;
174 std::cout.setf(std::ios::scientific);
175 std::cout <<
"w.mean() = " << w.
mean() << std::endl
176 <<
"w2.mean() = " << w2.mean() << std::endl
177 <<
"w3.mean() = " << w3.mean() << std::endl
178 <<
"w_gs.mean() = " << w_gs.mean() << std::endl
179 <<
"w_st.mean() = " << w_st.mean() << std::endl
180 <<
"w.std_dev() = " << w.standard_deviation() << std::endl
181 <<
"w2.std_dev() = " << w2.standard_deviation() << std::endl
182 <<
"w3.std_dev() = " << w3.standard_deviation() << std::endl
183 <<
"w_gs.std_dev() = " << w_gs.standard_deviation() << std::endl
184 <<
"w_st.std_dev() = " << w_st.standard_deviation() << std::endl;
186 catch (std::exception& e) {
187 std::cout << e.what() << std::endl;
void binary_op(const FuncT &func, 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)
Nonlinear binary function.
void sin(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
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)
value_type evaluate(const Teuchos::Array< value_type > &point) const
Evaluate polynomial approximation at a point.
void exp(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
pce_quad_func(const Stokhos::OrthogPolyApprox< int, double > &pce_, const Stokhos::OrthogPolyBasis< int, double > &basis_)
Teuchos::Array< double > vec
Stokhos::LegendreBasis< int, double > basis_type
Generates three-term recurrence using the Discretized Stieltjes procedure applied to a polynomial cha...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
const Stokhos::OrthogPolyBasis< int, double > & basis
Transforms a non-orthogonal multivariate basis to an orthogonal one using the Gram-Schmit procedure...
double operator()(const double &a, const double &b) const
const Stokhos::OrthogPolyApprox< int, double > & pce
void resize(size_type new_size, const value_type &x=value_type())
value_type mean() const
Compute mean of expansion.
Legendre polynomial basis.
int main(int argc, char **argv)
Defines quadrature for a tensor product basis by tensor products of 1-D quadrature rules...