Stokhos Development
Public Types | Public Member Functions | Protected Attributes
Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type > Class Template Reference

Class to store coefficients of a projection onto an orthogonal polynomial basis. More...

#include <Stokhos_OrthogPolyApprox.hpp>

Collaboration diagram for Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >:
Collaboration graph
[legend]

List of all members.

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.
OrthogPolyApproxoperator= (const OrthogPolyApprox &x)
 Assignment operator (deep copy)
OrthogPolyApproxoperator= (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.

Detailed Description

template<typename ordinal_type, typename value_type, typename storage_type = Stokhos::StandardStorage<ordinal_type, value_type>>
class Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >

Class to store coefficients of a projection onto an orthogonal polynomial basis.


Constructor & Destructor Documentation

template<typename ordinal_type, typename value_type, typename storage_type >
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).


Member Function Documentation

template<typename ordinal_type, typename value_type, typename storage_type >
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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator