Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_VectorOrthogPoly.hpp
Go to the documentation of this file.
1 // $Id$
2 // $Source$
3 // @HEADER
4 // ***********************************************************************
5 //
6 // Stokhos Package
7 // Copyright (2009) Sandia Corporation
8 //
9 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
10 // license for use of this work by or on behalf of the U.S. Government.
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions are
14 // met:
15 //
16 // 1. Redistributions of source code must retain the above copyright
17 // notice, this list of conditions and the following disclaimer.
18 //
19 // 2. Redistributions in binary form must reproduce the above copyright
20 // notice, this list of conditions and the following disclaimer in the
21 // documentation and/or other materials provided with the distribution.
22 //
23 // 3. Neither the name of the Corporation nor the names of the
24 // contributors may be used to endorse or promote products derived from
25 // this software without specific prior written permission.
26 //
27 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
28 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
31 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
33 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
35 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
36 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
37 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 //
39 // Questions? Contact Eric T. Phipps (etphipp@sandia.gov).
40 //
41 // ***********************************************************************
42 // @HEADER
43 
44 #ifndef STOKHOS_VECTORORTHOGPOLY_HPP
45 #define STOKHOS_VECTORORTHOGPOLY_HPP
46 
49 
50 namespace Stokhos {
51 
57  template <typename coeff_type>
58  class VectorOrthogPoly : public virtual ProductContainer<coeff_type> {
59  public:
60 
63 
66 
69 
71 
76 
84 
93  const typename traits_type::cloner_type& cloner);
94 
96 
100 
102  virtual ~VectorOrthogPoly();
103 
105 
109 
111 
114  void reset(
117  const typename traits_type::cloner_type& cloner);
118 
121  basis() const;
122 
124  coeff_type& term(ordinal_type dimension, ordinal_type order);
125 
127  const coeff_type& term(ordinal_type dimension, ordinal_type order) const;
128 
130 
133  void evaluate(const Teuchos::Array<value_type>& basis_values,
134  coeff_type& result) const;
135 
137  void sumIntoAllTerms(const value_type& weight,
138  const Teuchos::Array<value_type>& basis_values,
139  const Teuchos::Array<value_type>& basis_norms,
140  const coeff_type& vec);
141 
143  std::ostream& print(std::ostream& os) const;
144 
145  protected:
146 
149 
150  }; // class VectorOrthogPoly
151 
152  template <typename coeff_type>
153  std::ostream& operator << (std::ostream& os,
154  const VectorOrthogPoly<coeff_type>& vec) {
155  return vec.print(os);
156  }
157 
158 } // end namespace Stokhos
159 
160 // include template definitions
162 
163 #endif // STOKHOS_VECTORORTHOGPOLY_HPP
ProductContainer< coeff_type >::ordinal_type ordinal_type
Typename of ordinals.
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.
Cloner for Epetra_Vector coefficients.
VectorOrthogPoly()
Constructor with no basis.
std::ostream & print(std::ostream &os) const
Print polynomial.
VectorOrthogPoly & operator=(const VectorOrthogPoly &)
Assignment.
Base traits definition for ProductContainer.
Abstract base class for multivariate orthogonal polynomials.
std::ostream & operator<<(std::ostream &os, const ProductContainer< coeff_type > &vec)
Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > basis_
Basis.
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.
A container class storing an orthogonal polynomial whose coefficients are vectors, operators, or in general any type that would have an expensive copy constructor.
void evaluate(const Teuchos::Array< value_type > &basis_values, coeff_type &result) const
Evaluate polynomial at supplied basis values.
ProductContainer< coeff_type >::traits_type traits_type
Typename of traits.
Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > basis() const
Get basis.
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.
traits_type::value_type value_type
Typename of values.
coeff_type & term(ordinal_type dimension, ordinal_type order)
Get term for dimension dimension and order order.
ProductContainer< coeff_type >::value_type value_type
Typename of values.