Stokhos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
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
50namespace Stokhos {
51
57 template <typename coeff_type>
58 class VectorOrthogPoly : public virtual ProductContainer<coeff_type> {
59 public:
60
63
66
69
71
76
83 const Teuchos::RCP<const Epetra_BlockMap>& map);
84
92 const Teuchos::RCP<const Epetra_BlockMap>& map,
93 const typename traits_type::cloner_type& cloner);
94
96
100
102 virtual ~VectorOrthogPoly();
103
105
109
111
114 void reset(
115 const Teuchos::RCP<const Stokhos::OrthogPolyBasis<ordinal_type, value_type> >& new_basis,
116 const Teuchos::RCP<const Epetra_BlockMap>& new_map,
117 const typename traits_type::cloner_type& cloner);
118
120 Teuchos::RCP<const Stokhos::OrthogPolyBasis<ordinal_type, value_type> >
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
148 Teuchos::RCP<const Stokhos::OrthogPolyBasis<ordinal_type,value_type> > basis_;
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
Abstract base class for multivariate orthogonal polynomials.
Base traits definition for ProductContainer.
A product (in the mathematical sense) container class whose coefficients are vectors,...
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.
A container class storing an orthogonal polynomial whose coefficients are vectors,...
Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > basis() const
Get basis.
VectorOrthogPoly & operator=(const VectorOrthogPoly &)
Assignment.
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.
ProductContainer< coeff_type >::ordinal_type ordinal_type
Typename of ordinals.
std::ostream & print(std::ostream &os) const
Print polynomial.
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.
ProductContainer< coeff_type >::traits_type traits_type
Typename of traits.
ProductContainer< coeff_type >::value_type value_type
Typename of values.
Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > basis_
Basis.
VectorOrthogPoly()
Constructor with no basis.
void evaluate(const Teuchos::Array< value_type > &basis_values, coeff_type &result) const
Evaluate polynomial at supplied basis values.
coeff_type & term(ordinal_type dimension, ordinal_type order)
Get term for dimension dimension and order order.
Top-level namespace for Stokhos classes and functions.
std::ostream & operator<<(std::ostream &os, const ProductContainer< coeff_type > &vec)