Stokhos Development
Loading...
Searching...
No Matches
Stokhos::VectorOrthogPoly< coeff_type > Class Template Reference

A container class storing an orthogonal polynomial whose coefficients are vectors, operators, or in general any type that would have an expensive copy constructor. More...

#include <Stokhos_VectorOrthogPoly.hpp>

Inheritance diagram for Stokhos::VectorOrthogPoly< coeff_type >:
Collaboration diagram for Stokhos::VectorOrthogPoly< coeff_type >:

Public Types

typedef ProductContainer< coeff_type >::traits_type traits_type
 Typename of traits.
typedef ProductContainer< coeff_type >::value_type value_type
 Typename of values.
typedef ProductContainer< coeff_type >::ordinal_type ordinal_type
 Typename of ordinals.
Public Types inherited from Stokhos::ProductContainer< coeff_type >
typedef Stokhos::ProductContainerTraits< coeff_type > traits_type
 Typename of traits.
typedef traits_type::value_type value_type
 Typename of values.
typedef traits_type::ordinal_type ordinal_type
 Typename of ordinals.

Public Member Functions

 VectorOrthogPoly ()
 Constructor with no basis.
 VectorOrthogPoly (const Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > &basis, const Teuchos::RCP< const Epetra_BlockMap > &map)
 Create a polynomial for basis basis with empty coefficients.
 VectorOrthogPoly (const Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > &basis, const Teuchos::RCP< const Epetra_BlockMap > &map, const typename traits_type::cloner_type &cloner)
 Create a polynomial for basis basis where each coefficient is generated through a clone operation as implemented by the traits class for the coefficient.
 VectorOrthogPoly (const VectorOrthogPoly &)
 Copy constructor.
virtual ~VectorOrthogPoly ()
 Destructor.
VectorOrthogPolyoperator= (const VectorOrthogPoly &)
 Assignment.
void reset (const Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > &new_basis, const Teuchos::RCP< const Epetra_BlockMap > &new_map, const typename traits_type::cloner_type &cloner)
 Reset to a new basis.
Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > basis () const
 Get basis.
coeff_type & term (ordinal_type dimension, ordinal_type order)
 Get term for dimension dimension and order order.
const coeff_type & term (ordinal_type dimension, ordinal_type order) const
 Get term for dimension dimension and order order.
void evaluate (const Teuchos::Array< value_type > &basis_values, coeff_type &result) const
 Evaluate polynomial at supplied basis values.
void sumIntoAllTerms (const value_type &weight, const Teuchos::Array< value_type > &basis_values, const Teuchos::Array< value_type > &basis_norms, const coeff_type &vec)
 Evaluate polynomial at supplied basis values.
std::ostream & print (std::ostream &os) const
 Print polynomial.
Public Member Functions inherited from Stokhos::ProductContainer< coeff_type >
 ProductContainer ()
 Default constructor.
 ProductContainer (const Teuchos::RCP< const Epetra_BlockMap > &map)
 Create a container with container map map.
 ProductContainer (const Teuchos::RCP< const Epetra_BlockMap > &map, const typename traits_type::cloner_type &cloner)
 Create a container container map map where each coefficient is generated through a clone operation as implemented by the traits class for the coefficient.
 ProductContainer (const ProductContainer &)
 Copy constructor.
virtual ~ProductContainer ()
 Destructor.
ProductContaineroperator= (const ProductContainer &)
 Assignment.
void reset (const Teuchos::RCP< const Epetra_BlockMap > &map)
 Resize to new map map.
void reset (const Teuchos::RCP< const Epetra_BlockMap > &map, const typename traits_type::cloner_type &cloner)
 Resize to new map map and create coefficients from cloner.
void resize (const Teuchos::RCP< const Epetra_BlockMap > &map)
 Resize to map map.
void reserve (ordinal_type sz)
 Reserve space for a size sz container.
ordinal_type size () const
 Return size.
Teuchos::RCP< const Epetra_BlockMap > map () const
 Return container map.
const Teuchos::Array< Teuchos::RCP< coeff_type > > & getCoefficients () const
 Return array of coefficients.
Teuchos::Array< Teuchos::RCP< coeff_type > > & getCoefficients ()
 Return array of coefficients.
Teuchos::RCP< coeff_type > getCoeffPtr (ordinal_type i)
 Return ref-count pointer to coefficient i.
Teuchos::RCP< const coeff_type > getCoeffPtr (ordinal_type i) const
 Return ref-count pointer to constant coefficient i.
void setCoeffPtr (ordinal_type i, const Teuchos::RCP< coeff_type > &c)
 Set coefficient i to c.
coeff_type & operator[] (ordinal_type i)
 Array access.
const coeff_type & operator[] (ordinal_type i) const
 Array access.
void init (const value_type &val)
 Initialize coefficients.
bool myGID (int i) const
 Return whether global index i resides on this processor.
std::ostream & print (std::ostream &os) const
 Print polynomial.

Protected Attributes

Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > basis_
 Basis.
Protected Attributes inherited from Stokhos::ProductContainer< coeff_type >
Teuchos::RCP< const Epetra_BlockMap > map_
 Container map.
Teuchos::Array< Teuchos::RCP< coeff_type > > coeff_
 Array of polynomial coefficients.

Detailed Description

template<typename coeff_type>
class Stokhos::VectorOrthogPoly< coeff_type >

A container class storing an orthogonal polynomial whose coefficients are vectors, operators, or in general any type that would have an expensive copy constructor.

Constructor & Destructor Documentation

◆ VectorOrthogPoly() [1/2]

template<typename coeff_type>
Stokhos::VectorOrthogPoly< coeff_type >::VectorOrthogPoly ( )

Constructor with no basis.

Use with care! Generally you will want to call reset() before using any of the methods on this class.

References basis_, and Stokhos::ProductContainer< coeff_type >::ProductContainer().

◆ VectorOrthogPoly() [2/2]

template<typename coeff_type>
Stokhos::VectorOrthogPoly< coeff_type >::VectorOrthogPoly ( const VectorOrthogPoly< coeff_type > & v)

Copy constructor.

NOTE: This is a shallow copy

References basis_, and Stokhos::ProductContainer< coeff_type >::ProductContainer().

Member Function Documentation

◆ evaluate()

template<typename coeff_type>
void Stokhos::VectorOrthogPoly< coeff_type >::evaluate ( const Teuchos::Array< value_type > & basis_values,
coeff_type & result ) const

Evaluate polynomial at supplied basis values.

Currently doesn't work with parallel map.

References Stokhos::ProductContainer< coeff_type >::coeff_.

◆ operator=()

template<typename coeff_type>
Stokhos::VectorOrthogPoly< coeff_type > & Stokhos::VectorOrthogPoly< coeff_type >::operator= ( const VectorOrthogPoly< coeff_type > & v)

Assignment.

NOTE: This is a shallow copy

References basis_, and Stokhos::ProductContainer< coeff_type >::operator=().

◆ reset()

template<typename coeff_type>
void Stokhos::VectorOrthogPoly< coeff_type >::reset ( const Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > & new_basis,
const Teuchos::RCP< const Epetra_BlockMap > & new_map,
const typename traits_type::cloner_type & cloner )

Reset to a new basis.

This resizes array to fit new basis.


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