77 double operator() (
const double& a,
const double& b)
const {
88 template <
typename OrdinalType,
typename ValueType>
102 const OrdinalType d = 3;
103 const OrdinalType p = 5;
107 for (OrdinalType i=0; i<d; i++)
116 for (OrdinalType i=0; i<d; i++)
130 exp_params->
set(
"Use Quadrature for Times",
true);
148 u_st.term(0, 0) =
u.
mean();
149 u_st.term(0, 1) = 1.0;
151 v_st.
term(1, 1) = 1.0;
157 st_bases[0]->getQuadPoints(p+1, st_points_0, st_weights_0, st_values_0);
161 st_bases[1]->getQuadPoints(p+1, st_points_1, st_weights_1, st_values_1);
164 for (
int i=0; i<st_points_0.
size(); i++) {
165 (*st_points)[i].resize(2);
166 (*st_points)[i][0] = st_points_0[i];
167 (*st_points)[i][1] = st_points_1[i];
171 *st_weights = st_weights_0;
207 namespace GramSchmidtTest {
223 setup.gs_quad->getBasisAtQuadPoints();
225 for (
int i=0; i<
setup.gs_sz; i++) {
227 for (
int k=0; k<weights.
size(); k++)
228 mat(i,
j) += weights[k]*values[k][i]*values[k][
j];
236 out <<
"\n Error, mat.normInf() < tol = " << mat.
normInf()
237 <<
" < " << tol <<
": failed!\n";
238 out <<
"mat = " << mat << std::endl;
253 "w_gs.mean()",
setup.w_gs.mean(),
262 setup.w.standard_deviation(),
263 "w_gs.standard_devaition()",
264 setup.w_gs.standard_deviation(),
KOKKOS_INLINE_FUNCTION PCE< Storage > sqrt(const PCE< Storage > &a)
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > w_gs
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.
Teuchos::Array< double > vec
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeTripleProductTensor() const =0
Compute triple product tensor.
void exp(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
const Stokhos::OrthogPolyApprox< int, double > & pce
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > v
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)
GramSchmidt_PCE_Setup< int, double > setup
const Stokhos::OrthogPolyApprox< int, double > & pce
gram_schmidt_pce_binary_quad_func(const Stokhos::OrthogPolyApprox< int, double > &pce_, const Stokhos::OrthogPolyBasis< int, double > &basis_)
double operator()(const double &a) const
pointer coeff()
Return coefficient array.
Teuchos::Array< double > vec
const Stokhos::OrthogPolyBasis< int, double > & basis
static int runUnitTestsFromMain(int argc, char *argv[])
const Stokhos::OrthogPolyBasis< int, double > & basis
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > u
void reset(const Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > &new_basis, ordinal_type sz=0)
Reset to a new basis.
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > u_gs
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > v_gs
double operator()(const double &a, const double &b) const
TEUCHOS_UNIT_TEST(Stokhos_GramSchmidtBasis, Map)
Teuchos::RCP< const Stokhos::GramSchmidtBasis< OrdinalType, ValueType > > gs_basis
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeTripleProductTensor() const
Compute triple product tensor.
Stokhos::OrthogPolyApprox< OrdinalType, ValueType > w
value_type mean() const
Compute mean of expansion.
gram_schmidt_pce_unary_quad_func(const Stokhos::OrthogPolyApprox< int, double > &pce_, const Stokhos::OrthogPolyBasis< int, double > &basis_)
int main(int argc, char **argv)
Teuchos::RCP< const Stokhos::CompletePolynomialBasis< OrdinalType, ValueType > > basis
ScalarTraits< ScalarType >::magnitudeType normInf() const
Teuchos::RCP< const Stokhos::Quadrature< OrdinalType, ValueType > > gs_quad
virtual ordinal_type size() const
Return total size of basis.
bool testRelErr(const std::string &v1_name, const Scalar &v1, const std::string &v2_name, const Scalar &v2, const std::string &maxRelErr_error_name, const typename Teuchos::ScalarTraits< Scalar >::magnitudeType &maxRelErr_error, const std::string &maxRelErr_warning_name, const typename Teuchos::ScalarTraits< Scalar >::magnitudeType &maxRelErr_warning, const Ptr< std::ostream > &out)
Defines quadrature for a tensor product basis by tensor products of 1-D quadrature rules...
virtual ordinal_type size() const =0
Return total size of basis.
Teuchos::RCP< Stokhos::QuadOrthogPolyExpansion< OrdinalType, ValueType > > exp
reference term(ordinal_type dimension, ordinal_type order)
Get coefficient term for given dimension and order.