42#ifndef STOKHOS_MONOMIAL_PROJ_GRAM_SCHMIDT_PCE_BASIS2_HPP
43#define STOKHOS_MONOMIAL_PROJ_GRAM_SCHMIDT_PCE_BASIS2_HPP
45#include "Teuchos_RCP.hpp"
46#include "Teuchos_Array.hpp"
47#include "Teuchos_BLAS.hpp"
48#include "Teuchos_SerialDenseMatrix.hpp"
49#include "Teuchos_SerialDenseVector.hpp"
50#include "Teuchos_ParameterList.hpp"
68 template <
typename ordinal_type,
typename value_type>
85 const Teuchos::ParameterList&
params = Teuchos::ParameterList());
94 ordinal_type
order()
const;
100 virtual ordinal_type
size()
const;
107 virtual const Teuchos::Array<value_type>&
norm_squared()
const;
110 virtual const value_type&
norm_squared(ordinal_type i)
const;
120 Teuchos::RCP< Stokhos::Sparse3Tensor<ordinal_type, value_type> >
125 Teuchos::RCP< Stokhos::Sparse3Tensor<ordinal_type, value_type> >
137 const Teuchos::ArrayView<const value_type>& point,
138 Teuchos::Array<value_type>& basis_vals)
const;
141 virtual const std::string&
getName()
const;
144 virtual void print(std::ostream& os)
const;
155 ordinal_type ncol = 1,
156 bool transpose =
false)
const;
162 ordinal_type ncol = 1,
163 bool transpose =
false)
const;
166 virtual Teuchos::RCP<const Stokhos::Quadrature<ordinal_type, value_type> >
180 value_type threshold,
184 Teuchos::Array<ordinal_type>& num_terms_,
185 Teuchos::SerialDenseMatrix<ordinal_type,value_type>& Qp_,
186 Teuchos::SerialDenseMatrix<ordinal_type,value_type>& A_,
187 Teuchos::SerialDenseMatrix<ordinal_type,value_type>& F_);
200 typedef Teuchos::SerialDenseVector<ordinal_type,value_type>
SDV;
201 typedef Teuchos::SerialDenseMatrix<ordinal_type,value_type>
SDM;
210 Teuchos::RCP<const Stokhos::OrthogPolyBasis<ordinal_type,value_type> >
pce_basis;
225 Teuchos::Array< Stokhos::MultiIndex<ordinal_type> >
terms;
240 Teuchos::RCP<const Stokhos::Quadrature<ordinal_type, value_type> >
reduced_quad;
251 Teuchos::BLAS<ordinal_type,value_type>
blas;
Utilities for indexing a multi-variate complete polynomial basis.
Generate a basis from a given set of PCE expansions that is orthogonal with respect to the product me...
SDM Q
Values of transformed basis at quadrature points.
virtual ~MonomialProjGramSchmidtPCEBasis2()
Destructor.
Stokhos::CompletePolynomialBasisUtils< ordinal_type, value_type > CPBUtils
Teuchos::ParameterList params
Algorithm parameters.
Teuchos::Array< Stokhos::MultiIndex< ordinal_type > > terms
2-D array of basis terms
virtual void transformFromOriginalBasis(const value_type *in, value_type *out, ordinal_type ncol=1, bool transpose=false) const
Transform coefficients from original basis to this basis.
MonomialProjGramSchmidtPCEBasis2(const MonomialProjGramSchmidtPCEBasis2 &)
ordinal_type p
Total order of basis.
std::string orthogonalization_method
Orthogonalization method.
virtual const std::string & getName() const
Return string name of basis.
Teuchos::BLAS< ordinal_type, value_type > blas
virtual void transformToOriginalBasis(const value_type *in, value_type *out, ordinal_type ncol=1, bool transpose=false) const
Transform coefficients to original basis from this basis.
virtual ordinal_type size() const
Return total size of basis.
virtual Teuchos::RCP< const Stokhos::Quadrature< ordinal_type, value_type > > getReducedQuadrature() const
Get reduced quadrature object.
Teuchos::Array< ordinal_type > num_terms
Number of terms up to each order.
ordinal_type buildQ(ordinal_type max_p, value_type threshold, const Teuchos::Array< Stokhos::OrthogPolyApprox< ordinal_type, value_type > > &pce, const Teuchos::RCP< const Stokhos::Quadrature< ordinal_type, value_type > > &quad, Teuchos::Array< Stokhos::MultiIndex< ordinal_type > > &terms_, Teuchos::Array< ordinal_type > &num_terms_, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &Qp_, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &A_, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &F_)
Build the reduced basis, parameterized by total order max_p.
ordinal_type order() const
Return order of basis.
ordinal_type dimension() const
Return dimension of basis.
Teuchos::Array< value_type > norms
Norms.
ordinal_type pce_sz
Size of original pce basis.
Teuchos::SerialDenseMatrix< ordinal_type, value_type > SDM
value_type rank_threshold
Rank threshold.
MonomialProjGramSchmidtPCEBasis2 & operator=(const MonomialProjGramSchmidtPCEBasis2 &b)
Teuchos::SerialDenseVector< ordinal_type, value_type > SDV
virtual void print(std::ostream &os) const
Print basis to stream os.
Teuchos::RCP< const Stokhos::Quadrature< ordinal_type, value_type > > reduced_quad
Reduced quadrature object.
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeTripleProductTensor() const
Compute triple product tensor.
virtual const Teuchos::Array< value_type > & norm_squared() const
Return array storing norm-squared of each basis polynomial.
ordinal_type d
Total dimension of basis.
ordinal_type sz
Total size of basis.
bool verbose
Whether to print a bunch of stuff out.
Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > pce_basis
Original pce basis.
virtual value_type evaluateZero(ordinal_type i) const
Evaluate basis polynomial i at zero.
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeLinearTripleProductTensor() const
Compute linear triple product tensor where k = 0,1,..,d.
std::string name
Name of basis.
virtual void evaluateBases(const Teuchos::ArrayView< const value_type > &point, Teuchos::Array< value_type > &basis_vals) const
Evaluate basis polynomials at given point point.
SDM Qp
Coefficients of transformed basis in original basis.
A multidimensional index.
Class to store coefficients of a projection onto an orthogonal polynomial basis.
Abstract base class for quadrature methods.
Abstract base class for reduced basis strategies built from polynomial chaos expansions in some other...
Top-level namespace for Stokhos classes and functions.