Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
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>

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

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. More...
 
 OrthogPolyApprox (const OrthogPolyApprox &x)
 Copy constructor. More...
 
 ~OrthogPolyApprox ()
 Destructor. More...
 
OrthogPolyApproxoperator= (const OrthogPolyApprox &x)
 Assignment operator (deep copy) More...
 
OrthogPolyApproxoperator= (const value_type &v)
 Assignment operator with scalar. More...
 
void init (const value_type &v)
 Initialize coefficients to value. More...
 
void init (const value_type *v)
 Initialize coefficients to an array of values. More...
 
template<typename S >
void init (const OrthogPolyApprox< ordinal_type, value_type, S > &v)
 Initialize coefficients from an OrthogPolyApprox with different storage. More...
 
void load (value_type *v)
 Load coefficients to an array of values. More...
 
template<typename S >
void load (OrthogPolyApprox< ordinal_type, value_type, S > &v)
 Load coefficients into an OrthogPolyApprox with different storage. More...
 
Teuchos::RCP< const
Stokhos::OrthogPolyBasis
< ordinal_type, value_type > > 
basis () const
 Return basis. More...
 
void reset (const Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > &new_basis, ordinal_type sz=0)
 Reset to a new basis. More...
 
void resize (ordinal_type sz)
 Resize coefficient array (coefficients are preserved) More...
 
ordinal_type size () const
 Return size. More...
 
pointer coeff ()
 Return coefficient array. More...
 
const_pointer coeff () const
 Return coefficient array. More...
 
reference operator[] (ordinal_type i)
 Array access. More...
 
const_reference operator[] (ordinal_type i) const
 Array access. More...
 
reference term (ordinal_type dimension, ordinal_type order)
 Get coefficient term for given dimension and order. More...
 
const_reference term (ordinal_type dimension, ordinal_type order) const
 Get coefficient term for given dimension and order. More...
 
const MultiIndex< ordinal_type > & order (ordinal_type term) const
 Get orders for a given term. More...
 
value_type evaluate (const Teuchos::Array< value_type > &point) const
 Evaluate polynomial approximation at a point. More...
 
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. More...
 
value_type mean () const
 Compute mean of expansion. More...
 
value_type standard_deviation () const
 Compute standard deviation of expansion. More...
 
value_type two_norm () const
 Compute the two-norm of expansion. More...
 
value_type two_norm_squared () const
 Compute the squared two-norm of expansion. More...
 
value_type inner_product (const OrthogPolyApprox &b) const
 Compute the L2 inner product of 2 PCEs. More...
 
std::ostream & print (std::ostream &os) const
 Print approximation in basis. More...
 

Protected Attributes

Teuchos::RCP< const
Stokhos::OrthogPolyBasis
< ordinal_type, value_type > > 
basis_
 Basis expansion is relative to. More...
 
storage_type coeff_
 OrthogPolyApprox coefficients. More...
 

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.

Definition at line 29 of file Stokhos_OrthogPolyApprox.hpp.

Member Typedef Documentation

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

Definition at line 32 of file Stokhos_OrthogPolyApprox.hpp.

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

Definition at line 33 of file Stokhos_OrthogPolyApprox.hpp.

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

Definition at line 34 of file Stokhos_OrthogPolyApprox.hpp.

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

Definition at line 35 of file Stokhos_OrthogPolyApprox.hpp.

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).

Definition at line 14 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type, typename value_type, typename storage_type = Stokhos::StandardStorage<ordinal_type, value_type>>
Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::OrthogPolyApprox ( const OrthogPolyApprox< ordinal_type, value_type, storage_type > &  x)

Copy constructor.

template<typename ordinal_type , typename value_type , typename storage_type >
Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::~OrthogPolyApprox ( )

Destructor.

Definition at line 41 of file Stokhos_OrthogPolyApproxImp.hpp.

Member Function Documentation

template<typename ordinal_type, typename value_type, typename storage_type = Stokhos::StandardStorage<ordinal_type, value_type>>
OrthogPolyApprox& Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::operator= ( const OrthogPolyApprox< ordinal_type, value_type, storage_type > &  x)

Assignment operator (deep copy)

template<typename ordinal_type , typename value_type, typename storage_type >
Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type > & Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::operator= ( const value_type &  v)

Assignment operator with scalar.

Definition at line 61 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type , typename value_type, typename storage_type >
void Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::init ( const value_type &  v)

Initialize coefficients to value.

Definition at line 72 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type , typename value_type, typename storage_type >
void Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::init ( const value_type *  v)

Initialize coefficients to an array of values.

Definition at line 80 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type, typename value_type, typename storage_type = Stokhos::StandardStorage<ordinal_type, value_type>>
template<typename S >
void Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::init ( const OrthogPolyApprox< ordinal_type, value_type, S > &  v)
inline

Initialize coefficients from an OrthogPolyApprox with different storage.

Definition at line 69 of file Stokhos_OrthogPolyApprox.hpp.

template<typename ordinal_type , typename value_type, typename storage_type >
void Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::load ( value_type *  v)

Load coefficients to an array of values.

Definition at line 88 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type, typename value_type, typename storage_type = Stokhos::StandardStorage<ordinal_type, value_type>>
template<typename S >
void Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::load ( OrthogPolyApprox< ordinal_type, value_type, S > &  v)
inline

Load coefficients into an OrthogPolyApprox with different storage.

Definition at line 78 of file Stokhos_OrthogPolyApprox.hpp.

template<typename ordinal_type , typename value_type , typename storage_type >
Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::basis ( ) const

Return basis.

Definition at line 96 of file Stokhos_OrthogPolyApproxImp.hpp.

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.

Definition at line 104 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type, typename value_type , typename storage_type >
void Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::resize ( ordinal_type  sz)

Resize coefficient array (coefficients are preserved)

Definition at line 118 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type , typename value_type , typename storage_type >
ordinal_type Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::size ( ) const

Return size.

Definition at line 126 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type , typename value_type , typename storage_type >
Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::pointer Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::coeff ( )

Return coefficient array.

Definition at line 134 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type , typename value_type , typename storage_type >
Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::const_pointer Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::coeff ( ) const

Return coefficient array.

Definition at line 147 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type, typename value_type , typename storage_type >
Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::reference Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::operator[] ( ordinal_type  i)

Array access.

Definition at line 160 of file Stokhos_OrthogPolyApproxImp.hpp.

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

Definition at line 168 of file Stokhos_OrthogPolyApproxImp.hpp.

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

Definition at line 176 of file Stokhos_OrthogPolyApproxImp.hpp.

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

Get coefficient term for given dimension and order.

Definition at line 190 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type, typename value_type , typename storage_type >
const Stokhos::MultiIndex< ordinal_type > & Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::order ( ordinal_type  term) const

Get orders for a given term.

Definition at line 204 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type , typename value_type, typename storage_type >
value_type Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::evaluate ( const Teuchos::Array< value_type > &  point) const

Evaluate polynomial approximation at a point.

Definition at line 214 of file Stokhos_OrthogPolyApproxImp.hpp.

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

Definition at line 224 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type , typename value_type , typename storage_type >
value_type Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::mean ( ) const

Compute mean of expansion.

Definition at line 237 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type , typename value_type , typename storage_type >
value_type Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::standard_deviation ( ) const

Compute standard deviation of expansion.

Definition at line 245 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type , typename value_type , typename storage_type >
value_type Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::two_norm ( ) const

Compute the two-norm of expansion.

Definition at line 258 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type , typename value_type , typename storage_type >
value_type Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::two_norm_squared ( ) const

Compute the squared two-norm of expansion.

Definition at line 266 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type, typename value_type, typename storage_type = Stokhos::StandardStorage<ordinal_type, value_type>>
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.

Definition at line 285 of file Stokhos_OrthogPolyApproxImp.hpp.

template<typename ordinal_type , typename value_type , typename storage_type >
std::ostream & Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::print ( std::ostream &  os) const

Print approximation in basis.

Definition at line 312 of file Stokhos_OrthogPolyApproxImp.hpp.

Member Data Documentation

template<typename ordinal_type, typename value_type, typename storage_type = Stokhos::StandardStorage<ordinal_type, value_type>>
Teuchos::RCP<const Stokhos::OrthogPolyBasis<ordinal_type, value_type> > Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::basis_
protected

Basis expansion is relative to.

Definition at line 147 of file Stokhos_OrthogPolyApprox.hpp.

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

OrthogPolyApprox coefficients.

Definition at line 150 of file Stokhos_OrthogPolyApprox.hpp.


The documentation for this class was generated from the following files: