10 template <
typename coeff_type>
18 template <
typename coeff_type>
22 coeff_(map_->NumMyElements())
26 template <
typename coeff_type>
29 const typename traits_type::cloner_type& cloner) :
31 coeff_(map_->NumMyElements())
35 coeff_[i] = cloner.clone(i);
38 template <
typename coeff_type>
46 template <
typename coeff_type>
52 template <
typename coeff_type>
64 template <
typename coeff_type>
74 template <
typename coeff_type>
78 const typename traits_type::cloner_type& cloner)
84 coeff_[i] = cloner.clone(i);
87 template <
typename coeff_type>
93 coeff_.resize(map_->NumMyElements());
96 template <
typename coeff_type>
104 template <
typename coeff_type>
109 return coeff_.size();
112 template <
typename coeff_type>
120 template <
typename coeff_type>
128 template <
typename coeff_type>
136 template <
typename coeff_type>
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>
181 return map_->MyGID(i);
184 template <
typename coeff_type>
191 traits_type::init(*(coeff_[i]), val);
194 template <
typename coeff_type>
201 os <<
"Stokhos::ProductContainer of global size " << map_->NumGlobalElements()
202 <<
", local size " << sz <<
":" << std::endl;
204 os <<
"Term " << map_->GID(i) <<
":" << std::endl;
205 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.