44#ifndef STOKHOS_ORTHOGPOLYAPPROX_HPP
45#define STOKHOS_ORTHOGPOLYAPPROX_HPP
47#include "Teuchos_RCP.hpp"
81 const value_type* vals = NULL);
96 void init(
const value_type& v);
99 void init(
const value_type* v);
102 template <
typename S>
108 void load(value_type* v);
111 template <
typename S>
117 Teuchos::RCP<const Stokhos::OrthogPolyBasis<ordinal_type, value_type> >
127 void resize(ordinal_type sz);
130 ordinal_type
size()
const;
154 value_type
evaluate(
const Teuchos::Array<value_type>& point)
const;
157 value_type
evaluate(
const Teuchos::Array<value_type>& point,
158 const Teuchos::Array<value_type>& basis_vals)
const;
161 value_type
mean()
const;
176 std::ostream&
print(std::ostream& os)
const;
181 Teuchos::RCP<const Stokhos::OrthogPolyBasis<ordinal_type, value_type> >
basis_;
189 template <
typename ordinal_type,
typename value_type,
typename node_type>
A multidimensional index.
Class to store coefficients of a projection onto an orthogonal polynomial basis.
storage_type::reference reference
void reset(const Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > &new_basis, ordinal_type sz=0)
Reset to a new basis.
value_type inner_product(const OrthogPolyApprox &b) const
Compute the L2 inner product of 2 PCEs.
Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > basis_
Basis expansion is relative to.
value_type mean() const
Compute mean of expansion.
storage_type::const_reference const_reference
std::ostream & print(std::ostream &os) const
Print approximation in basis.
void init(const value_type &v)
Initialize coefficients to value.
value_type two_norm() const
Compute the two-norm of expansion.
storage_type::pointer pointer
OrthogPolyApprox & operator=(const OrthogPolyApprox &x)
Assignment operator (deep copy)
value_type standard_deviation() const
Compute standard deviation of expansion.
storage_type coeff_
OrthogPolyApprox coefficients.
void resize(ordinal_type sz)
Resize coefficient array (coefficients are preserved)
void load(OrthogPolyApprox< ordinal_type, value_type, S > &v)
Load coefficients into an OrthogPolyApprox with different storage.
const MultiIndex< ordinal_type > & order(ordinal_type term) const
Get orders for a given term.
void load(value_type *v)
Load coefficients to an array of values.
reference operator[](ordinal_type i)
Array access.
pointer coeff()
Return coefficient array.
void init(const OrthogPolyApprox< ordinal_type, value_type, S > &v)
Initialize coefficients from an OrthogPolyApprox with different storage.
value_type two_norm_squared() const
Compute the squared two-norm of expansion.
storage_type::const_pointer const_pointer
reference term(ordinal_type dimension, ordinal_type order)
Get coefficient term for given dimension and order.
ordinal_type size() const
Return size.
value_type evaluate(const Teuchos::Array< value_type > &point) const
Evaluate polynomial approximation at a point.
Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > basis() const
Return basis.
~OrthogPolyApprox()
Destructor.
OrthogPolyApprox(const OrthogPolyApprox &x)
Copy constructor.
Abstract base class for multivariate orthogonal polynomials.
const value_type * const_pointer
void load(pointer v)
Load values to an array of values.
const value_type & const_reference
void init(const_reference v)
Initialize values to a constant value.
Top-level namespace for Stokhos classes and functions.
std::ostream & operator<<(std::ostream &os, const ProductContainer< coeff_type > &vec)