42 template <
typename coeff_type>
50 template <
typename coeff_type>
54 coeff_(map_->NumMyElements())
58 template <
typename coeff_type>
61 const typename traits_type::cloner_type& cloner) :
63 coeff_(map_->NumMyElements())
67 coeff_[i] = cloner.clone(i);
70 template <
typename coeff_type>
78 template <
typename coeff_type>
84 template <
typename coeff_type>
96 template <
typename coeff_type>
106 template <
typename coeff_type>
110 const typename traits_type::cloner_type& cloner)
116 coeff_[i] = cloner.clone(i);
119 template <
typename coeff_type>
125 coeff_.resize(map_->NumMyElements());
128 template <
typename coeff_type>
136 template <
typename coeff_type>
141 return coeff_.size();
144 template <
typename coeff_type>
152 template <
typename coeff_type>
160 template <
typename coeff_type>
168 template <
typename coeff_type>
176 template <
typename coeff_type>
184 template <
typename coeff_type>
192 template <
typename coeff_type>
200 template <
typename coeff_type>
208 template <
typename coeff_type>
213 return map_->MyGID(i);
216 template <
typename coeff_type>
223 traits_type::init(*(coeff_[i]), val);
226 template <
typename coeff_type>
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]));
Teuchos::RCP< const Epetra_BlockMap > map() const
Return 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.
ProductContainer & operator=(const ProductContainer &)
Assignment.
void init(const value_type &val)
Initialize coefficients.
coeff_type & operator[](ordinal_type i)
Array access.
int NumMyElements() const
Teuchos::RCP< const Epetra_BlockMap > map_
Container map.
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.
virtual ~ProductContainer()
Destructor.
Teuchos::Array< Teuchos::RCP< coeff_type > > coeff_
Array of polynomial coefficients.
Teuchos::RCP< coeff_type > getCoeffPtr(ordinal_type i)
Return ref-count pointer to coefficient i.
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.
traits_type::ordinal_type ordinal_type
Typename of ordinals.
ProductContainer()
Default constructor.
std::ostream & print(std::ostream &os) const
Print polynomial.
traits_type::value_type value_type
Typename of values.
void reserve(ordinal_type sz)
Reserve space for a size sz container.
ordinal_type size() const
Return size.
void resize(const Teuchos::RCP< const Epetra_BlockMap > &map)
Resize to map map.