Stokhos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
Stokhos::ProductContainer< coeff_type > Class Template Reference

A product (in the mathematical sense) container class whose coefficients are vectors, operators, or in general any type that would have an expensive copy constructor.
More...

#include <Stokhos_ProductContainer.hpp>

Inheritance diagram for Stokhos::ProductContainer< coeff_type >:
Inheritance graph
[legend]

Public Types

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

 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_BlockMapmap () 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 Epetra_BlockMapmap_
 Container map.
 
Teuchos::Array< Teuchos::RCP< coeff_type > > coeff_
 Array of polynomial coefficients.
 

Detailed Description

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

A product (in the mathematical sense) container class whose coefficients are vectors, operators, or in general any type that would have an expensive copy constructor.

Definition at line 61 of file Stokhos_ProductContainer.hpp.

Member Typedef Documentation

◆ traits_type

template<typename coeff_type >
typedef Stokhos::ProductContainerTraits<coeff_type> Stokhos::ProductContainer< coeff_type >::traits_type

Typename of traits.

Definition at line 65 of file Stokhos_ProductContainer.hpp.

◆ value_type

template<typename coeff_type >
typedef traits_type::value_type Stokhos::ProductContainer< coeff_type >::value_type

Typename of values.

Definition at line 68 of file Stokhos_ProductContainer.hpp.

◆ ordinal_type

template<typename coeff_type >
typedef traits_type::ordinal_type Stokhos::ProductContainer< coeff_type >::ordinal_type

Typename of ordinals.

Definition at line 71 of file Stokhos_ProductContainer.hpp.

Constructor & Destructor Documentation

◆ ProductContainer() [1/4]

template<typename coeff_type >
Stokhos::ProductContainer< coeff_type >::ProductContainer

Default constructor.

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

Definition at line 43 of file Stokhos_ProductContainerImp.hpp.

◆ ProductContainer() [2/4]

template<typename coeff_type >
Stokhos::ProductContainer< coeff_type >::ProductContainer ( const Teuchos::RCP< const Epetra_BlockMap > &  map)

Create a container with container map map.

Definition at line 51 of file Stokhos_ProductContainerImp.hpp.

◆ ProductContainer() [3/4]

template<typename coeff_type >
Stokhos::ProductContainer< coeff_type >::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.

Definition at line 59 of file Stokhos_ProductContainerImp.hpp.

◆ ProductContainer() [4/4]

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

Copy constructor.

NOTE: This is a shallow copy

Definition at line 71 of file Stokhos_ProductContainerImp.hpp.

◆ ~ProductContainer()

template<typename coeff_type >
Stokhos::ProductContainer< coeff_type >::~ProductContainer
virtual

Destructor.

Definition at line 79 of file Stokhos_ProductContainerImp.hpp.

Member Function Documentation

◆ operator=()

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

Assignment.

NOTE: This is a shallow copy

Definition at line 86 of file Stokhos_ProductContainerImp.hpp.

◆ reset() [1/2]

template<typename coeff_type >
void Stokhos::ProductContainer< coeff_type >::reset ( const Teuchos::RCP< const Epetra_BlockMap > &  map)

Resize to new map map.

Any previous coefficients are lost.

Definition at line 98 of file Stokhos_ProductContainerImp.hpp.

◆ reset() [2/2]

template<typename coeff_type >
void Stokhos::ProductContainer< coeff_type >::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.

Any previous coefficients are lost.

Definition at line 108 of file Stokhos_ProductContainerImp.hpp.

◆ resize()

template<typename coeff_type >
void Stokhos::ProductContainer< coeff_type >::resize ( const Teuchos::RCP< const Epetra_BlockMap > &  map)

Resize to map map.

Coefficients are preserved.

Definition at line 121 of file Stokhos_ProductContainerImp.hpp.

◆ reserve()

template<typename coeff_type >
void Stokhos::ProductContainer< coeff_type >::reserve ( ordinal_type  sz)

Reserve space for a size sz container.

Coefficients are preserved.

Definition at line 130 of file Stokhos_ProductContainerImp.hpp.

◆ size()

template<typename coeff_type >
Stokhos::ProductContainer< coeff_type >::ordinal_type Stokhos::ProductContainer< coeff_type >::size

Return size.

Definition at line 138 of file Stokhos_ProductContainerImp.hpp.

◆ map()

template<typename coeff_type >
Teuchos::RCP< const Epetra_BlockMap > Stokhos::ProductContainer< coeff_type >::map

Return container map.

Definition at line 146 of file Stokhos_ProductContainerImp.hpp.

◆ getCoefficients() [1/2]

template<typename coeff_type >
const Teuchos::Array< Teuchos::RCP< coeff_type > > & Stokhos::ProductContainer< coeff_type >::getCoefficients

Return array of coefficients.

Definition at line 154 of file Stokhos_ProductContainerImp.hpp.

◆ getCoefficients() [2/2]

template<typename coeff_type >
Teuchos::Array< Teuchos::RCP< coeff_type > > & Stokhos::ProductContainer< coeff_type >::getCoefficients

Return array of coefficients.

Definition at line 162 of file Stokhos_ProductContainerImp.hpp.

◆ getCoeffPtr() [1/2]

template<typename coeff_type >
Teuchos::RCP< coeff_type > Stokhos::ProductContainer< coeff_type >::getCoeffPtr ( ordinal_type  i)

Return ref-count pointer to coefficient i.

Definition at line 170 of file Stokhos_ProductContainerImp.hpp.

◆ getCoeffPtr() [2/2]

template<typename coeff_type >
Teuchos::RCP< const coeff_type > Stokhos::ProductContainer< coeff_type >::getCoeffPtr ( ordinal_type  i) const

Return ref-count pointer to constant coefficient i.

Definition at line 178 of file Stokhos_ProductContainerImp.hpp.

◆ setCoeffPtr()

template<typename coeff_type >
void Stokhos::ProductContainer< coeff_type >::setCoeffPtr ( ordinal_type  i,
const Teuchos::RCP< coeff_type > &  c 
)

Set coefficient i to c.

Definition at line 186 of file Stokhos_ProductContainerImp.hpp.

◆ operator[]() [1/2]

template<typename coeff_type >
coeff_type & Stokhos::ProductContainer< coeff_type >::operator[] ( ordinal_type  i)

Array access.

Definition at line 194 of file Stokhos_ProductContainerImp.hpp.

◆ operator[]() [2/2]

template<typename coeff_type >
const coeff_type & Stokhos::ProductContainer< coeff_type >::operator[] ( ordinal_type  i) const

Array access.

Definition at line 202 of file Stokhos_ProductContainerImp.hpp.

◆ init()

template<typename coeff_type >
void Stokhos::ProductContainer< coeff_type >::init ( const value_type val)

Initialize coefficients.

Definition at line 218 of file Stokhos_ProductContainerImp.hpp.

◆ myGID()

template<typename coeff_type >
bool Stokhos::ProductContainer< coeff_type >::myGID ( int  i) const

Return whether global index i resides on this processor.

Definition at line 210 of file Stokhos_ProductContainerImp.hpp.

◆ print()

template<typename coeff_type >
std::ostream & Stokhos::ProductContainer< coeff_type >::print ( std::ostream &  os) const

Print polynomial.

Definition at line 228 of file Stokhos_ProductContainerImp.hpp.

Member Data Documentation

◆ map_

template<typename coeff_type >
Teuchos::RCP<const Epetra_BlockMap> Stokhos::ProductContainer< coeff_type >::map_
protected

Container map.

Definition at line 176 of file Stokhos_ProductContainer.hpp.

◆ coeff_

template<typename coeff_type >
Teuchos::Array< Teuchos::RCP<coeff_type> > Stokhos::ProductContainer< coeff_type >::coeff_
protected

Array of polynomial coefficients.

Definition at line 179 of file Stokhos_ProductContainer.hpp.


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