Stokhos Package Browser (Single Doxygen Collection)
Version of the Day
|
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 . More... | |
OrthogPolyApprox (const OrthogPolyApprox &x) | |
Copy constructor. More... | |
~OrthogPolyApprox () | |
Destructor. More... | |
OrthogPolyApprox & | operator= (const OrthogPolyApprox &x) |
Assignment operator (deep copy) More... | |
OrthogPolyApprox & | operator= (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... | |
Class to store coefficients of a projection onto an orthogonal polynomial basis.
Definition at line 29 of file Stokhos_OrthogPolyApprox.hpp.
typedef storage_type::reference Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::reference |
Definition at line 32 of file Stokhos_OrthogPolyApprox.hpp.
typedef storage_type::const_reference Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::const_reference |
Definition at line 33 of file Stokhos_OrthogPolyApprox.hpp.
typedef storage_type::pointer Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::pointer |
Definition at line 34 of file Stokhos_OrthogPolyApprox.hpp.
typedef storage_type::const_pointer Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::const_pointer |
Definition at line 35 of file Stokhos_OrthogPolyApprox.hpp.
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.
Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::OrthogPolyApprox | ( | const OrthogPolyApprox< ordinal_type, value_type, storage_type > & | x | ) |
Copy constructor.
Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::~OrthogPolyApprox | ( | ) |
Destructor.
Definition at line 41 of file Stokhos_OrthogPolyApproxImp.hpp.
OrthogPolyApprox& Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::operator= | ( | const OrthogPolyApprox< ordinal_type, value_type, storage_type > & | x | ) |
Assignment operator (deep copy)
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.
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.
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.
|
inline |
Initialize coefficients from an OrthogPolyApprox with different storage.
Definition at line 69 of file Stokhos_OrthogPolyApprox.hpp.
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.
|
inline |
Load coefficients into an OrthogPolyApprox with different storage.
Definition at line 78 of file Stokhos_OrthogPolyApprox.hpp.
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.
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.
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.
ordinal_type Stokhos::OrthogPolyApprox< ordinal_type, value_type, storage_type >::size | ( | ) | const |
Return size.
Definition at line 126 of file Stokhos_OrthogPolyApproxImp.hpp.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
|
protected |
Basis expansion is relative to.
Definition at line 147 of file Stokhos_OrthogPolyApprox.hpp.
|
protected |
OrthogPolyApprox coefficients.
Definition at line 150 of file Stokhos_OrthogPolyApprox.hpp.