Stokhos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Stokhos_OrthogPolyExpansion.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_ORTHOGPOLYEXPANSION_HPP
45#define STOKHOS_ORTHOGPOLYEXPANSION_HPP
46
47#include <cmath>
48#include <algorithm> // for std::min and std::max
49
52
53namespace Stokhos {
54
56 template <typename ordinal_type, typename value_type,
58 value_type> >
60 public:
61
63 typedef Sparse3Tensor<ordinal_type, value_type> tp_type;
64
67
70
72 virtual ordinal_type size() const = 0;
73
75 virtual Teuchos::RCP<const OrthogPolyBasis<ordinal_type, value_type> >
76 getBasis() const = 0;
77
79 virtual Teuchos::RCP<const Sparse3Tensor<ordinal_type, value_type> >
80 getTripleProduct() const = 0;
81
82 // Operations
83 virtual void unaryMinus(
84 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
85 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
86
87 virtual void plusEqual(
88 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
89 const value_type& x) = 0;
90 virtual void minusEqual(
91 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
92 const value_type& x) = 0;
93 virtual void timesEqual(
94 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
95 const value_type& x) = 0;
96 virtual void divideEqual(
97 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
98 const value_type& x) = 0;
99
100 virtual void plusEqual(
101 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
102 const OrthogPolyApprox<ordinal_type, value_type, node_type>& x) = 0;
103 virtual void minusEqual(
104 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
105 const OrthogPolyApprox<ordinal_type, value_type, node_type>& x) = 0;
106 virtual void timesEqual(
107 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
108 const OrthogPolyApprox<ordinal_type, value_type, node_type>& x) = 0;
109 virtual void divideEqual(
110 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
111 const OrthogPolyApprox<ordinal_type, value_type, node_type>& x) = 0;
112
113 virtual void plus(
114 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
115 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
116 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
117 virtual void plus(
118 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
119 const value_type& a,
120 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
121 virtual void plus(
122 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
123 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
124 const value_type& b) = 0;
125 virtual void minus(
126 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
127 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
128 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
129 virtual void minus(
130 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
131 const value_type& a,
132 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
133 virtual void minus(
134 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
135 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
136 const value_type& b) = 0;
137 virtual void times(
138 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
139 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
140 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
141 virtual void times(
142 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
143 const value_type& a,
144 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
145 virtual void times(
146 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
147 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
148 const value_type& b) = 0;
149 virtual void divide(
150 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
151 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
152 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
153 virtual void divide(
154 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
155 const value_type& a,
156 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
157 virtual void divide(
158 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
159 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
160 const value_type& b) = 0;
161
162 virtual void exp(
163 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
164 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
165 virtual void log(
166 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
167 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
168 virtual void log10(
169 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
170 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
171 virtual void sqrt(
172 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
173 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
174 virtual void cbrt(
175 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
176 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
177 virtual void pow(
178 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
179 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
180 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
181 virtual void pow(
182 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
183 const value_type& a,
184 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
185 virtual void pow(
186 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
187 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
188 const value_type& b) = 0;
189 virtual void cos(
190 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
191 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
192 virtual void sin(
193 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
194 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
195 virtual void tan(
196 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
197 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
198 virtual void cosh(
199 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
200 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
201 virtual void sinh(
202 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
203 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
204 virtual void tanh(
205 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
206 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
207 virtual void acos(
208 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
209 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
210 virtual void asin(
211 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
212 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
213 virtual void atan(
214 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
215 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
216// virtual void atan2(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
217// const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
218// const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
219// virtual void atan2(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
220// const T& a,
221// const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
222// virtual void atan2(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
223// const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
224// const T& b) = 0;
225 virtual void acosh(
226 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
227 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
228 virtual void asinh(
229 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
230 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
231 virtual void atanh(
232 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
233 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
234 virtual void abs(
235 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
236 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
237 virtual void fabs(
238 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
239 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a) = 0;
240 virtual void max(
241 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
242 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
243 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
244 virtual void max(
245 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
246 const value_type& a,
247 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
248 virtual void max(
249 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
250 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
251 const value_type& b) = 0;
252 virtual void min(
253 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
254 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
255 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
256 virtual void min(
257 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
258 const value_type& a,
259 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
260 virtual void min(
261 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
262 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
263 const value_type& b) = 0;
264
265 private:
266
267 // Prohibit copying
269
270 // Prohibit Assignment
272
273 }; // class OrthogPolyExpansion
274
275} // namespace Stokhos
276
277#endif // STOKHOS_ORTHOGPOLYEXPANSION_HPP
Kokkos::Serial node_type
Abstract base class for orthogonal polynomial-based expansions.
virtual void tanh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void log10(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void divide(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
virtual void divide(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const value_type &b)=0
virtual void atan(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void times(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
virtual void unaryMinus(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void divideEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)=0
virtual void timesEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &x)=0
virtual void asinh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void plusEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)=0
virtual void min(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
virtual void minusEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &x)=0
virtual void pow(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
virtual void min(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const value_type &b)=0
virtual ordinal_type size() const =0
Get expansion size.
virtual void minus(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
virtual void cosh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void timesEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)=0
virtual void sin(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void acosh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void sinh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void max(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
virtual void times(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const value_type &b)=0
virtual void pow(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const value_type &b)=0
virtual void minusEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)=0
OrthogPolyExpansion & operator=(const OrthogPolyExpansion &b)
virtual void exp(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void minus(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const value_type &b)=0
virtual void max(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const value_type &b)=0
virtual void divide(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
virtual void min(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
virtual void abs(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void plus(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
virtual void tan(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void max(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
virtual void atanh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void sqrt(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void asin(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void cos(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void pow(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
virtual void acos(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual Teuchos::RCP< const OrthogPolyBasis< ordinal_type, value_type > > getBasis() const =0
Get basis.
OrthogPolyExpansion(const OrthogPolyExpansion &)
virtual void plus(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const value_type &b)=0
virtual Teuchos::RCP< const Sparse3Tensor< ordinal_type, value_type > > getTripleProduct() const =0
Get triple product.
Sparse3Tensor< ordinal_type, value_type > tp_type
Typename of TripleProduct tensor.
virtual void plus(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
virtual void fabs(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void times(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
virtual void log(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void cbrt(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
virtual void plusEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &x)=0
virtual void divideEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &x)=0
virtual void minus(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
Top-level namespace for Stokhos classes and functions.