10 #ifndef STOKHOS_QUADRATURE_PSEUDO_SPECTRAL_OPERATOR_HPP
11 #define STOKHOS_QUADRATURE_PSEUDO_SPECTRAL_OPERATOR_HPP
24 template <
typename ordinal_t,
26 typename point_compare_type =
27 typename DefaultPointCompare<ordinal_t,value_t>::type>
49 const point_compare_type& point_compare = point_compare_type()) :
67 thePoint[k] = quad_points[i][k];
69 points[thePoint] = std::make_pair(quad_weights[i],i);
77 typename point_set_type::iterator di =
points.begin();
78 typename point_set_type::iterator di_end =
points.end();
80 for (; di != di_end; ++di) {
83 qp2pce(i,jdx) = quad_weights[
j]*quad_vals[
j][i] /
85 pce2qp(jdx,i) = quad_vals[
j][i];
94 while (di != di_end) {
95 di->second.second = idx;
141 it ==
points.end(), std::logic_error,
"Invalid term " <<
point);
142 return it->second.second;
161 bool trans =
false)
const {
185 bool trans =
false)
const {
set_iterator set_begin()
Iterator to begining of point set.
ScalarType * values() const
Teuchos::BLAS< ordinal_type, value_type > blas
BLAS wrappers.
point_set_type::iterator set_iterator
std::map< point_type, std::pair< value_type, ordinal_type >, point_compare_type > point_set_type
Teuchos::SerialDenseMatrix< ordinal_type, value_type > pce2qp
Matrix mapping coefficients to points.
const_set_iterator set_begin() const
Iterator to begining of point set.
ordinal_type coeff_sz
Number of coefficients.
Container storing a term in a generalized tensor product.
base_type::point_set_type point_set_type
base_type::iterator iterator
int multiply(ETransp transa, ETransp transb, ScalarType alpha, const SerialDenseMatrix< OrdinalType, ScalarType > &A, const SerialDenseMatrix< OrdinalType, ScalarType > &B, ScalarType beta)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual 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.
An operator interface for building pseudo-spectral approximations.
virtual ordinal_type size() const =0
Get number of quadrature points.
virtual const Teuchos::Array< Teuchos::Array< value_type > > & getBasisAtQuadPoints() const =0
Get values of basis at quadrature points.
ordinal_type index(const point_type &point) const
Get point index for given point.
base_type::const_iterator const_iterator
iterator begin()
Iterator to begining of point set.
MultiIndex< ordinal_type > multiindex_type
Teuchos::SerialDenseMatrix< ordinal_type, value_type > qp2pce
Matrix mapping points to coefficients.
void GEMM(ETransp transa, ETransp transb, const OrdinalType &m, const OrdinalType &n, const OrdinalType &k, const alpha_type alpha, const A_type *A, const OrdinalType &lda, const B_type *B, const OrdinalType &ldb, const beta_type beta, ScalarType *C, const OrdinalType &ldc) const
virtual ordinal_type dimension() const =0
Return dimension of basis.
ordinal_type point_size() const
Number of points.
point_map_type point_map
Map index to point term.
virtual ~QuadraturePseudoSpectralOperator()
Destructor.
virtual const Teuchos::Array< value_type > & getQuadWeights() const =0
Get quadrature weights.
ordinal_type coeff_size() const
Number of coefficients.
base_type::const_set_iterator const_set_iterator
Abstract base class for multivariate orthogonal polynomials.
virtual const Teuchos::Array< Teuchos::Array< value_type > > & getQuadPoints() const =0
Get quadrature points.
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.
Abstract base class for quadrature methods.
PseudoSpectralOperator< ordinal_type, value_type, point_compare_type > base_type
iterator end()
Iterator to end of point set.
void resize(size_type new_size, const value_type &x=value_type())
base_type::point_map_type point_map_type
const_iterator end() const
Iterator to end of point set.
virtual const Teuchos::Array< value_type > & norm_squared() const =0
Return array storing norm-squared of each basis polynomial.
OrdinalType numCols() const
base_type::point_type point_type
int reshape(OrdinalType numRows, OrdinalType numCols)
point_map_type::iterator iterator
base_type::set_iterator set_iterator
const point_type & point(ordinal_type n) const
Get point for given index.
const_set_iterator set_end() const
Iterator to end of point set.
#define TEUCHOS_ASSERT(assertion_test)
const_iterator begin() const
Iterator to begining of point set.
point_map_type::const_iterator const_iterator
An operator for building pseudo-spectral coefficients using an arbitrary quadrature rule...
point_set_type points
Quadrature points.
virtual ordinal_type size() const =0
Return total size of basis.
OrdinalType stride() const
OrdinalType numRows() const
set_iterator set_end()
Iterator to end of point set.
point_set_type::const_iterator const_set_iterator
QuadraturePseudoSpectralOperator(const OrthogPolyBasis< ordinal_type, value_type > &basis, const Quadrature< ordinal_type, value_type > &quad, const point_compare_type &point_compare=point_compare_type())
Constructor.