42template <
typename coeff_type>
50template <
typename coeff_type>
54 coeff_(map_->NumMyElements())
58template <
typename coeff_type>
61 const typename traits_type::cloner_type& cloner) :
63 coeff_(map_->NumMyElements())
67 coeff_[i] = cloner.clone(i);
70template <
typename coeff_type>
78template <
typename coeff_type>
84template <
typename coeff_type>
96template <
typename coeff_type>
99reset(
const Teuchos::RCP<const Epetra_BlockMap>& theMap)
106template <
typename coeff_type>
109reset(
const Teuchos::RCP<const Epetra_BlockMap>& theMap,
110 const typename traits_type::cloner_type& cloner)
116 coeff_[i] = cloner.clone(i);
119template <
typename coeff_type>
122resize(
const Teuchos::RCP<const Epetra_BlockMap>& theMap)
125 coeff_.resize(map_->NumMyElements());
128template <
typename coeff_type>
136template <
typename coeff_type>
141 return coeff_.size();
144template <
typename coeff_type>
145Teuchos::RCP<const Epetra_BlockMap>
152template <
typename coeff_type>
153const Teuchos::Array<Teuchos::RCP<coeff_type> >&
160template <
typename coeff_type>
161Teuchos::Array<Teuchos::RCP<coeff_type> >&
168template <
typename coeff_type>
169Teuchos::RCP<coeff_type>
176template <
typename coeff_type>
177Teuchos::RCP<const coeff_type>
184template <
typename coeff_type>
192template <
typename coeff_type>
200template <
typename coeff_type>
208template <
typename coeff_type>
213 return map_->MyGID(i);
216template <
typename coeff_type>
223 traits_type::init(*(coeff_[i]),
val);
226template <
typename coeff_type>
229print(std::ostream& os)
const
231 Teuchos::Array<ordinal_type> trm;
233 os <<
"Stokhos::ProductContainer of global size " << map_->NumGlobalElements()
234 <<
", local size " << sz <<
":" << std::endl;
236 os <<
"Term " << map_->GID(i) <<
":" << std::endl;
237 traits_type::print(os, *(coeff_[i]));
A product (in the mathematical sense) container class whose coefficients are vectors,...
ProductContainer()
Default constructor.
traits_type::value_type value_type
Typename of values.
traits_type::ordinal_type ordinal_type
Typename of ordinals.
Teuchos::RCP< const Epetra_BlockMap > map() const
Return container map.
Teuchos::Array< Teuchos::RCP< coeff_type > > coeff_
Array of polynomial coefficients.
void reserve(ordinal_type sz)
Reserve space for a size sz container.
const Teuchos::Array< Teuchos::RCP< coeff_type > > & getCoefficients() const
Return array of coefficients.
void reset(const Teuchos::RCP< const Epetra_BlockMap > &map)
Resize to new map map.
std::ostream & print(std::ostream &os) const
Print polynomial.
Teuchos::RCP< coeff_type > getCoeffPtr(ordinal_type i)
Return ref-count pointer to coefficient i.
void init(const value_type &val)
Initialize coefficients.
virtual ~ProductContainer()
Destructor.
ProductContainer & operator=(const ProductContainer &)
Assignment.
ordinal_type size() const
Return size.
void resize(const Teuchos::RCP< const Epetra_BlockMap > &map)
Resize to map map.
coeff_type & operator[](ordinal_type i)
Array access.
Teuchos::RCP< const Epetra_BlockMap > map_
Container map.
void setCoeffPtr(ordinal_type i, const Teuchos::RCP< coeff_type > &c)
Set coefficient i to c.
bool myGID(int i) const
Return whether global index i resides on this processor.