|
Stokhos Development
|
Class to store coefficients of a projection onto an orthogonal polynomial basis. More...
#include <Stokhos_OrthogPolyApprox.hpp>
Public Types | |
| typedef storage_type::reference | reference |
| typedef storage_type::const_reference | const_reference |
| typedef storage_type::pointer | pointer |
| typedef storage_type::const_pointer | const_pointer |
Public Member Functions | |
| OrthogPolyApprox (const Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > &basis=Teuchos::null, ordinal_type sz=0, const value_type *vals=NULL) | |
Constructor with supplied size sz. | |
| OrthogPolyApprox (const OrthogPolyApprox &x) | |
| Copy constructor. | |
| ~OrthogPolyApprox () | |
| Destructor. | |
| OrthogPolyApprox & | operator= (const OrthogPolyApprox &x) |
| Assignment operator (deep copy). | |
| OrthogPolyApprox & | operator= (const value_type &v) |
| Assignment operator with scalar. | |
| void | init (const value_type &v) |
| Initialize coefficients to value. | |
| void | init (const value_type *v) |
| Initialize coefficients to an array of values. | |
| template<typename S> | |
| void | init (const OrthogPolyApprox< ordinal_type, value_type, S > &v) |
| Initialize coefficients from an OrthogPolyApprox with different storage. | |
| void | load (value_type *v) |
| Load coefficients to an array of values. | |
| template<typename S> | |
| void | load (OrthogPolyApprox< ordinal_type, value_type, S > &v) |
| Load coefficients into an OrthogPolyApprox with different storage. | |
| Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > | basis () const |
| Return basis. | |
| void | reset (const Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > &new_basis, ordinal_type sz=0) |
| Reset to a new basis. | |
| void | resize (ordinal_type sz) |
| Resize coefficient array (coefficients are preserved). | |
| ordinal_type | size () const |
| Return size. | |
| pointer | coeff () |
| Return coefficient array. | |
| const_pointer | coeff () const |
| Return coefficient array. | |
| reference | operator[] (ordinal_type i) |
| Array access. | |
| const_reference | operator[] (ordinal_type i) const |
| Array access. | |
| reference | term (ordinal_type dimension, ordinal_type order) |
| Get coefficient term for given dimension and order. | |
| const_reference | term (ordinal_type dimension, ordinal_type order) const |
| Get coefficient term for given dimension and order. | |
| const MultiIndex< ordinal_type > & | order (ordinal_type term) const |
| Get orders for a given term. | |
| value_type | evaluate (const Teuchos::Array< value_type > &point) const |
| Evaluate polynomial approximation at a point. | |
| value_type | evaluate (const Teuchos::Array< value_type > &point, const Teuchos::Array< value_type > &basis_vals) const |
| Evaluate polynomial approximation at a point with supplied basis values. | |
| value_type | mean () const |
| Compute mean of expansion. | |
| value_type | standard_deviation () const |
| Compute standard deviation of expansion. | |
| value_type | two_norm () const |
| Compute the two-norm of expansion. | |
| value_type | two_norm_squared () const |
| Compute the squared two-norm of expansion. | |
| value_type | inner_product (const OrthogPolyApprox &b) const |
| Compute the L2 inner product of 2 PCEs. | |
| std::ostream & | print (std::ostream &os) const |
| Print approximation in basis. | |
Protected Attributes | |
| Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > | basis_ |
| Basis expansion is relative to. | |
| storage_type | coeff_ |
| OrthogPolyApprox coefficients. | |
Class to store coefficients of a projection onto an orthogonal polynomial basis.
| Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::OrthogPolyApprox | ( | const Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > & | basis = Teuchos::null, |
| ordinal_type | sz = 0, | ||
| const value_type * | vals = NULL ) |
Constructor with supplied size sz.
Normally sz should equal the basis size, however this is not enforced since other situations can arise, e.g., using a size of 1 for a constant expansion. If sz = 0, it is computed from the basis size (and is 1 if basis is null).
References basis_, and coeff_.
Referenced by init(), load(), operator=(), and OrthogPolyApprox().
| Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::OrthogPolyApprox | ( | const OrthogPolyApprox< ordinal_type, value_type, storage_type > & | x | ) |
Copy constructor.
References OrthogPolyApprox().
| Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::basis | ( | ) | const |
Return basis.
Referenced by Stokhos::HouseTriDiagPCEBasis< ordinal_type, value_type >::HouseTriDiagPCEBasis().
| Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::pointer Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::coeff | ( | ) |
Return coefficient array.
Referenced by Stokhos::PseudoSpectralOrthogPolyExpansion< ordinal_type, value_type, point_compare_type, node_type >::binary_op(), Stokhos::PseudoSpectralOrthogPolyExpansion< ordinal_type, value_type, point_compare_type, node_type >::binary_op(), Stokhos::PseudoSpectralOrthogPolyExpansion< ordinal_type, value_type, point_compare_type, node_type >::binary_op(), Stokhos::QuadOrthogPolyExpansion< ordinal_type, value_type, node_type >::binary_op(), Stokhos::QuadOrthogPolyExpansion< ordinal_type, value_type, node_type >::binary_op(), Stokhos::QuadOrthogPolyExpansion< ordinal_type, value_type, node_type >::binary_op(), Stokhos::StieltjesGramSchmidtBuilder< ordinal_type, value_type >::computeReducedPCEs(), init(), load(), Stokhos::PseudoSpectralOrthogPolyExpansion< ordinal_type, value_type, point_compare_type, node_type >::unary_op(), and Stokhos::QuadOrthogPolyExpansion< ordinal_type, value_type, node_type >::unary_op().
| Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::const_pointer Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::coeff | ( | ) | const |
Return coefficient array.
References coeff_.
| value_type Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::evaluate | ( | const Teuchos::Array< value_type > & | point | ) | const |
Evaluate polynomial approximation at a point.
References basis_, and evaluate().
Referenced by evaluate(), and Stokhos::MonoProjPCEBasis< ordinal_type, value_type >::MonoProjPCEBasis().
| value_type Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::evaluate | ( | const Teuchos::Array< value_type > & | point, |
| const Teuchos::Array< value_type > & | basis_vals ) const |
Evaluate polynomial approximation at a point with supplied basis values.
References coeff_.
|
inline |
Initialize coefficients from an OrthogPolyApprox with different storage.
References coeff(), coeff_, and OrthogPolyApprox().
| void Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::init | ( | const value_type & | v | ) |
Initialize coefficients to value.
Referenced by Stokhos::OrthogPolyApprox< OrdinalType, ValueType >::init(), and operator=().
| void Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::init | ( | const value_type * | v | ) |
Initialize coefficients to an array of values.
References coeff_.
| value_type Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::inner_product | ( | const OrthogPolyApprox< ordinal_type, value_type, storage_type > & | b | ) | const |
Compute the L2 inner product of 2 PCEs.
References basis_, coeff_, and Stokhos::ProductContainer< coeff_type >::coeff_.
|
inline |
Load coefficients into an OrthogPolyApprox with different storage.
References coeff(), coeff_, and OrthogPolyApprox().
| value_type Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::mean | ( | ) | const |
Compute mean of expansion.
References coeff_.
| OrthogPolyApprox & Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::operator= | ( | const OrthogPolyApprox< ordinal_type, value_type, storage_type > & | x | ) |
Assignment operator (deep copy).
References init(), operator=(), and OrthogPolyApprox().
Referenced by operator=().
| Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::reference Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::operator[] | ( | ordinal_type | i | ) |
Array access.
References coeff_.
| Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::const_reference Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::operator[] | ( | ordinal_type | i | ) | const |
Array access.
References coeff_.
| const Stokhos::MultiIndex< ordinal_type > & Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::order | ( | ordinal_type | term | ) | const |
Get orders for a given term.
References basis_.
| std::ostream & Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::print | ( | std::ostream & | os | ) | const |
Print approximation in basis.
References basis_, coeff_, Stokhos::MultiIndex< ordinal_t >::size(), and Stokhos::ProductContainer< coeff_type >::size().
| void Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::reset | ( | const Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > & | new_basis, |
| ordinal_type | sz = 0 ) |
Reset to a new basis.
This resizes array to fit new basis. Coefficients are preserved.
| void Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::resize | ( | ordinal_type | sz | ) |
Resize coefficient array (coefficients are preserved).
Referenced by Stokhos::PseudoSpectralOrthogPolyExpansion< ordinal_type, value_type, point_compare_type, node_type >::binary_op(), Stokhos::PseudoSpectralOrthogPolyExpansion< ordinal_type, value_type, point_compare_type, node_type >::binary_op(), Stokhos::PseudoSpectralOrthogPolyExpansion< ordinal_type, value_type, point_compare_type, node_type >::binary_op(), Stokhos::QuadOrthogPolyExpansion< ordinal_type, value_type, node_type >::binary_op(), Stokhos::QuadOrthogPolyExpansion< ordinal_type, value_type, node_type >::binary_op(), Stokhos::QuadOrthogPolyExpansion< ordinal_type, value_type, node_type >::binary_op(), Stokhos::PseudoSpectralOrthogPolyExpansion< ordinal_type, value_type, point_compare_type, node_type >::unary_op(), and Stokhos::QuadOrthogPolyExpansion< ordinal_type, value_type, node_type >::unary_op().
| ordinal_type Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::size | ( | ) | const |
Return size.
Referenced by Stokhos::PseudoSpectralOrthogPolyExpansion< ordinal_type, value_type, point_compare_type, node_type >::binary_op(), Stokhos::PseudoSpectralOrthogPolyExpansion< ordinal_type, value_type, point_compare_type, node_type >::binary_op(), Stokhos::PseudoSpectralOrthogPolyExpansion< ordinal_type, value_type, point_compare_type, node_type >::binary_op(), Stokhos::QuadOrthogPolyExpansion< ordinal_type, value_type, node_type >::binary_op(), Stokhos::QuadOrthogPolyExpansion< ordinal_type, value_type, node_type >::binary_op(), Stokhos::QuadOrthogPolyExpansion< ordinal_type, value_type, node_type >::binary_op(), Stokhos::PseudoSpectralOrthogPolyExpansion< ordinal_type, value_type, point_compare_type, node_type >::unary_op(), and Stokhos::QuadOrthogPolyExpansion< ordinal_type, value_type, node_type >::unary_op().
| value_type Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::standard_deviation | ( | ) | const |
| Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::reference Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::term | ( | ordinal_type | dimension, |
| ordinal_type | order ) |
Get coefficient term for given dimension and order.
References basis_, and coeff_.
Referenced by Stokhos::StieltjesGramSchmidtBuilder< ordinal_type, value_type >::computeReducedPCEs().
| Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::const_reference Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::term | ( | ordinal_type | dimension, |
| ordinal_type | order ) const |
| value_type Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::two_norm | ( | ) | const |
Compute the two-norm of expansion.
References two_norm_squared().
| value_type Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::two_norm_squared | ( | ) | const |
|
protected |
Basis expansion is relative to.
Referenced by evaluate(), inner_product(), order(), OrthogPolyApprox(), print(), standard_deviation(), term(), term(), and two_norm_squared().
|
protected |
OrthogPolyApprox coefficients.
Referenced by coeff(), evaluate(), init(), init(), inner_product(), load(), mean(), operator[](), operator[](), OrthogPolyApprox(), print(), standard_deviation(), term(), term(), and two_norm_squared().