42 #ifndef STOKHOS_SMOLYAK_PSEUDO_SPECTRAL_OPERATOR_HPP 43 #define STOKHOS_SMOLYAK_PSEUDO_SPECTRAL_OPERATOR_HPP 48 #include "Teuchos_SerialDenseMatrix.hpp" 49 #include "Teuchos_BLAS.hpp" 57 template <
typename ordinal_t,
59 typename point_compare_type =
81 template <
typename coeff_compare_type>
84 bool use_smolyak_apply =
true,
86 const point_compare_type& point_compare = point_compare_type());
124 TEUCHOS_TEST_FOR_EXCEPTION(
125 it ==
points.end(), std::logic_error,
"Invalid term " <<
point);
126 return it->second.second;
142 const Teuchos::SerialDenseMatrix<ordinal_type,value_type>& input,
143 Teuchos::SerialDenseMatrix<ordinal_type,value_type>& result,
145 bool trans =
false)
const;
157 const Teuchos::SerialDenseMatrix<ordinal_type,value_type>& input,
158 Teuchos::SerialDenseMatrix<ordinal_type,value_type>& result,
160 bool trans =
false)
const;
166 const Teuchos::SerialDenseMatrix<ordinal_type,value_type>& A,
168 const Teuchos::SerialDenseMatrix<ordinal_type,value_type>& input,
169 Teuchos::SerialDenseMatrix<ordinal_type,value_type>& result,
179 const Teuchos::SerialDenseMatrix<ordinal_type,value_type>& input,
180 Teuchos::SerialDenseMatrix<ordinal_type,value_type>& result,
190 const Teuchos::SerialDenseMatrix<ordinal_type,value_type>& input,
191 Teuchos::SerialDenseMatrix<ordinal_type,value_type>& result,
196 const Teuchos::Array<ordinal_type>& map,
197 const Teuchos::SerialDenseMatrix<ordinal_type,value_type>& input,
199 Teuchos::SerialDenseMatrix<ordinal_type,value_type>& result)
const;
202 const Teuchos::Array<ordinal_type>& map,
203 const Teuchos::SerialDenseMatrix<ordinal_type,value_type>& input,
205 Teuchos::SerialDenseMatrix<ordinal_type,value_type>& result)
const;
234 Teuchos::SerialDenseMatrix<ordinal_type,value_type>
qp2pce;
237 Teuchos::SerialDenseMatrix<ordinal_type,value_type>
pce2qp;
240 Teuchos::BLAS<ordinal_type,value_type>
blas;
Teuchos::SerialDenseMatrix< ordinal_type, value_type > pce2qp
Matrix mapping coefficients to points.
point_set_type::iterator set_iterator
virtual ~SmolyakPseudoSpectralOperator()
Destructor.
std::map< point_type, std::pair< value_type, ordinal_type >, point_compare_type > point_set_type
const_set_iterator set_end() const
Iterator to end of point set.
point_map_type point_map
Map index to sparse grid term.
Teuchos::SerialDenseMatrix< ordinal_type, value_type > qp2pce
Matrix mapping points to coefficients.
set_iterator set_end()
Iterator to end of point set.
Container storing a term in a generalized tensor product.
ordinal_type point_size() const
Number of points.
Teuchos::Array< point_type > point_map_type
base_type::const_set_iterator const_set_iterator
base_type::point_map_type point_map_type
base_type::iterator iterator
const_iterator end() const
Iterator to end of point set.
An operator interface for building pseudo-spectral approximations.
iterator begin()
Iterator to begining of point set.
virtual void transformPCE2QP(const value_type &alpha, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &input, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &result, const value_type &beta, bool trans=false) const
Transform PCE coefficients to quadrature values.
ordinal_type coeff_size() const
Number of coefficients.
Teuchos::Array< Teuchos::RCP< operator_type > > operator_set_type
void apply_direct(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &A, const value_type &alpha, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &input, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &result, const value_type &beta, bool trans) const
Apply transformation operator using direct method.
Teuchos::Array< Teuchos::Array< ordinal_type > > gather_maps
Gather maps for each operator for Smolyak apply.
ordinal_type index(const point_type &point) const
Get point index for given point.
Teuchos::Array< Teuchos::Array< ordinal_type > > scatter_maps
Scatter maps for each operator for Smolyak apply.
const_iterator begin() const
Iterator to begining of point set.
ordinal_type coeff_sz
Number of coefficients.
base_type::point_set_type point_set_type
iterator end()
Iterator to end of point set.
Top-level namespace for Stokhos classes and functions.
An operator for building pseudo-spectral coefficients using a sparse Smolyak construction.
Teuchos::BLAS< ordinal_type, value_type > blas
BLAS wrappers.
void transformQP2PCE(const value_type &alpha, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &input, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &result, const value_type &beta, bool trans=false) const
Transform values at quadrature points to PCE coefficients.
base_type::point_type point_type
base_type::const_iterator const_iterator
Teuchos::Array< value_type > smolyak_coeffs
Smolyak coefficients.
Multivariate orthogonal polynomial basis generated from a Smolyak sparse grid.
const point_type & point(ordinal_type n) const
Get point for given index.
void transformPCE2QP_smolyak(const value_type &alpha, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &input, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &result, const value_type &beta, bool trans) const
Transform PCE coefficients to values at quadrature points using Smolyak formula.
void scatter(const Teuchos::Array< ordinal_type > &map, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &input, bool trans, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &result) const
MultiIndex< ordinal_type > multiindex_type
point_map_type::iterator iterator
const_set_iterator set_begin() const
Iterator to begining of point set.
SmolyakPseudoSpectralOperator(const SmolyakBasis< ordinal_type, value_type, coeff_compare_type > &smolyak_basis, bool use_smolyak_apply=true, bool use_pst=true, const point_compare_type &point_compare=point_compare_type())
Constructor.
An operator for building pseudo-spectral coefficients using tensor-product quadrature.
TensorProductPseudoSpectralOperator< ordinal_type, value_type > operator_type
void gather(const Teuchos::Array< ordinal_type > &map, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &input, bool trans, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &result) const
set_iterator set_begin()
Iterator to begining of point set.
point_map_type::const_iterator const_iterator
LexographicLess< TensorProductElement< ordinal_type, value_type >, FloatingPointLess< value_type > > type
base_type::set_iterator set_iterator
bool use_smolyak
Use Smolyak apply method.
PseudoSpectralOperator< ordinal_type, value_type, point_compare_type > base_type
point_set_type points
Smolyak sparse grid.
point_set_type::const_iterator const_set_iterator
void transformQP2PCE_smolyak(const value_type &alpha, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &input, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &result, const value_type &beta, bool trans) const
Transform values at quadrature points to PCE coefficients using Smolyak formula.
operator_set_type operators
Tensor pseudospectral operators.