43 double operator() (
const double& a,
const double& b)
const {
54 template <
typename OrdinalType,
typename ValueType>
68 const OrdinalType d = 3;
69 const OrdinalType p = 5;
73 for (OrdinalType i=0; i<d; i++)
82 for (OrdinalType i=0; i<d; i++)
96 exp_params->
set(
"Use Quadrature for Times",
true);
114 u_st.term(0, 0) =
u.
mean();
115 u_st.term(0, 1) = 1.0;
117 v_st.
term(1, 1) = 1.0;
123 st_bases[0]->getQuadPoints(p+1, st_points_0, st_weights_0, st_values_0);
127 st_bases[1]->getQuadPoints(p+1, st_points_1, st_weights_1, st_values_1);
130 for (
int i=0; i<st_points_0.
size(); i++) {
131 (*st_points)[i].resize(2);
132 (*st_points)[i][0] = st_points_0[i];
133 (*st_points)[i][1] = st_points_1[i];
137 *st_weights = st_weights_0;
173 namespace GramSchmidtTest {
189 setup.gs_quad->getBasisAtQuadPoints();
191 for (
int i=0; i<
setup.gs_sz; i++) {
193 for (
int k=0; k<weights.
size(); k++)
194 mat(i,
j) += weights[k]*values[k][i]*values[k][
j];
202 out <<
"\n Error, mat.normInf() < tol = " << mat.
normInf()
203 <<
" < " << tol <<
": failed!\n";
204 out <<
"mat = " <<
printMat(mat) << std::endl;
219 "w_gs.mean()",
setup.w_gs.mean(),
228 setup.w.standard_deviation(),
229 "w_gs.standard_devaition()",
230 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
SerialBandDenseMatrixPrinter< OrdinalType, ScalarType > printMat(const SerialBandDenseMatrix< OrdinalType, ScalarType > &obj)
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
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
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
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
bool testRelErr(const std::string &v1_name, const T1 &v1, const std::string &v2_name, const T2 &v2, const std::string &maxRelErr_error_name, const typename TestRelErr< T1, T2 >::magnitudeType &maxRelErr_error, const std::string &maxRelErr_warning_name, const typename TestRelErr< T1, T2 >::magnitudeType &maxRelErr_warning, const Ptr< std::ostream > &out)
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.
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.