42 #ifndef STOKHOS_SMOLYAK_BASIS_HPP
43 #define STOKHOS_SMOLYAK_BASIS_HPP
60 typename coeff_compare_type =
61 TotalOrderLess<MultiIndex<ordinal_type> > >
72 template <
typename index_set_type>
76 const index_set_type& index_set,
78 const coeff_compare_type& coeff_compare = coeff_compare_type());
134 virtual void print(std::ostream& os)
const;
137 virtual const std::string&
getName()
const;
243 template <
typename tp_predicate_type>
std::map< coeff_type, ordinal_type, coeff_compare_type > coeff_set_type
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeTripleProductTensor() const
Compute triple product tensor.
virtual value_type evaluateZero(ordinal_type i) const
Evaluate basis polynomial i at zero.
coeff_type max_orders
Maximum orders for each dimension.
Teuchos::Array< Teuchos::RCP< const OneDOrthogPolyBasis< ordinal_type, value_type > > > getCoordinateBases() const
Return coordinate bases.
coeff_set_type basis_set
Basis set.
ordinal_type getNumSmolyakTerms() const
Return number of terms in Smolyak formula.
ordinal_type getSmolyakCoefficient(ordinal_type i) const
Return ith smolyak coefficient.
ordinal_type sz
Total size of basis.
SmolyakPredicate< TensorProductPredicate< ordinal_type > > sm_pred
Predicate for building sparse triple products.
ordinal_type p
Total order of basis.
std::string name
Name of basis.
SmolyakBasis & operator=(const SmolyakBasis &b)
Teuchos::Array< value_type > norms
Norms.
Teuchos::Array< coeff_type > coeff_map_type
virtual MultiIndex< ordinal_type > getMaxOrders() const
Return maximum order allowable for each coordinate basis.
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeLinearTripleProductTensor() const
Compute linear triple product tensor where k = 0,1,..,d.
virtual void evaluateBases(const Teuchos::ArrayView< const value_type > &point, Teuchos::Array< value_type > &basis_vals) const
Evaluate basis polynomials at given point point.
Teuchos::Array< Teuchos::RCP< tensor_product_basis_type > > tp_bases
Tensor product bases comprising Smolyak set.
virtual ~SmolyakBasis()
Destructor.
Abstract base class for multivariate orthogonal polynomials generated from tensor products of univari...
Teuchos::Array< ordinal_type > smolyak_coeffs
Smolyak coefficients.
SmolyakBasis(const Teuchos::Array< Teuchos::RCP< const OneDOrthogPolyBasis< ordinal_type, value_type > > > &bases, const index_set_type &index_set, const value_type &sparse_tol=1.0e-12, const coeff_compare_type &coeff_compare=coeff_compare_type())
Constructor.
MultiIndex< ordinal_type > multiindex_type
virtual const std::string & getName() const
Return string name of basis.
Predicate functor for building sparse triple products.
Multivariate orthogonal polynomial basis generated from a Smolyak sparse grid.
ordinal_type dimension() const
Return dimension of basis.
Multivariate orthogonal polynomial basis generated from a tensor product of univariate polynomials...
virtual const MultiIndex< ordinal_type > & term(ordinal_type i) const
Get orders of each coordinate polynomial given an index i.
ordinal_type d
Total dimension of basis.
bool operator()(const coeff_type &term) const
Abstract base class for 1-D orthogonal polynomials.
virtual ordinal_type size() const
Return total size of basis.
MultiIndex< ordinal_type > coeff_type
Teuchos::RCP< const tensor_product_basis_type > getTensorProductBasis(ordinal_type i) const
Return ith tensor product basis.
Teuchos::Array< Teuchos::RCP< const OneDOrthogPolyBasis< ordinal_type, value_type > > > bases
Array of bases.
A comparison functor implementing a strict weak ordering based lexographic ordering.
virtual ordinal_type index(const MultiIndex< ordinal_type > &term) const
Get index of the multivariate polynomial given orders of each coordinate.
coeff_map_type basis_map
Basis map.
Teuchos::Array< Teuchos::Array< value_type > > basis_eval_tmp
Temporary array used in basis evaluation.
ordinal_type order() const
Return order of basis.
TensorProductBasis< ordinal_type, value_type, LexographicLess< coeff_type > > tensor_product_basis_type
virtual const Teuchos::Array< value_type > & norm_squared() const
Return array storing norm-squared of each basis polynomial.
virtual void print(std::ostream &os) const
Print basis to stream os.
Teuchos::Array< tp_predicate_type > tp_preds
value_type sparse_tol
Tolerance for computing sparse Cijk.