Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_ConstantOrthogPolyExpansionImp.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 template <typename ordinal_type, typename value_type>
13 {
14 }
15 
16 template <typename ordinal_type, typename value_type>
17 void
22 {
23  if (c.size() < 1)
24  c.resize(1);
25  c[0] = -a[0];
26 }
27 
28 template <typename ordinal_type, typename value_type>
29 void
32  const value_type& val)
33 {
34  if (c.size() < 1)
35  c.resize(1);
36  c[0] += val;
37 }
38 
39 template <typename ordinal_type, typename value_type>
40 void
43  const value_type& val)
44 {
45  if (c.size() < 1)
46  c.resize(1);
47  c[0] -= val;
48 }
49 
50 template <typename ordinal_type, typename value_type>
51 void
54  const value_type& val)
55 {
56  if (c.size() < 1)
57  c.resize(1);
58  c[0] *= val;
59 }
60 
61 template <typename ordinal_type, typename value_type>
62 void
65  const value_type& val)
66 {
67  if (c.size() < 1)
68  c.resize(1);
69  c[0] /= val;
70 }
71 
72 template <typename ordinal_type, typename value_type>
73 void
78 {
79  if (c.size() < 1)
80  c.resize(1);
81  c[0] += x[0];
82 }
83 
84 template <typename ordinal_type, typename value_type>
85 void
90 {
91  if (c.size() < 1)
92  c.resize(1);
93  c[0] -= x[0];
94 }
95 
96 template <typename ordinal_type, typename value_type>
97 void
102 {
103  if (c.size() < 1)
104  c.resize(1);
105  c[0] *= x[0];
106 }
107 
108 template <typename ordinal_type, typename value_type>
109 void
113 {
114  if (c.size() < 1)
115  c.resize(1);
116  c[0] /= x[0];
117 }
118 
119 template <typename ordinal_type, typename value_type>
120 void
125 {
126  if (c.size() < 1)
127  c.resize(1);
128  c[0] = a[0] + b[0];
129 }
130 
131 template <typename ordinal_type, typename value_type>
132 void
135  const value_type& a,
137 {
138  if (c.size() < 1)
139  c.resize(1);
140  c[0] = a + b[0];
141 }
142 
143 template <typename ordinal_type, typename value_type>
144 void
148  const value_type& b)
149 {
150  if (c.size() < 1)
151  c.resize(1);
152  c[0] = a[0] + b;
153 }
154 
155 template <typename ordinal_type, typename value_type>
156 void
161 {
162  if (c.size() < 1)
163  c.resize(1);
164  c[0] = a[0] - b[0];
165 }
166 
167 template <typename ordinal_type, typename value_type>
168 void
171  const value_type& a,
173 {
174  if (c.size() < 1)
175  c.resize(1);
176  c[0] = a - b[0];
177 }
178 
179 template <typename ordinal_type, typename value_type>
180 void
184  const value_type& b)
185 {
186  if (c.size() < 1)
187  c.resize(1);
188  c[0] = a[0] - b;
189 }
190 
191 template <typename ordinal_type, typename value_type>
192 void
197 {
198  if (c.size() < 1)
199  c.resize(1);
200  c[0] = a[0] * b[0];
201 }
202 
203 template <typename ordinal_type, typename value_type>
204 void
207  const value_type& a,
209 {
210  if (c.size() < 1)
211  c.resize(1);
212  c[0] = a * b[0];
213 }
214 
215 template <typename ordinal_type, typename value_type>
216 void
220  const value_type& b)
221 {
222  if (c.size() < 1)
223  c.resize(1);
224  c[0] = a[0] * b;
225 }
226 
227 template <typename ordinal_type, typename value_type>
228 void
233 {
234  if (c.size() < 1)
235  c.resize(1);
236  c[0] = a[0] / b[0];
237 }
238 
239 template <typename ordinal_type, typename value_type>
240 void
243  const value_type& a,
245 {
246  if (c.size() < 1)
247  c.resize(1);
248  c[0] = a / b[0];
249 }
250 
251 template <typename ordinal_type, typename value_type>
252 void
256  const value_type& b)
257 {
258  if (c.size() < 1)
259  c.resize(1);
260  c[0] = a[0] / b;
261 }
262 
263 template <typename ordinal_type, typename value_type>
264 void
268 {
269  if (c.size() < 1)
270  c.resize(1);
271  c[0] = std::exp(a[0]);
272 }
273 
274 template <typename ordinal_type, typename value_type>
275 void
279 {
280  if (c.size() < 1)
281  c.resize(1);
282  c[0] = std::log(a[0]);
283 }
284 
285 template <typename ordinal_type, typename value_type>
286 void
290 {
291  if (c.size() < 1)
292  c.resize(1);
293  c[0] = std::log10(a[0]);
294 }
295 
296 template <typename ordinal_type, typename value_type>
297 void
301 {
302  if (c.size() < 1)
303  c.resize(1);
304  c[0] = std::sqrt(a[0]);
305 }
306 
307 template <typename ordinal_type, typename value_type>
308 void
312 {
313  if (c.size() < 1)
314  c.resize(1);
315  c[0] = std::cbrt(a[0]);
316 }
317 
318 template <typename ordinal_type, typename value_type>
319 void
324 {
325  if (c.size() < 1)
326  c.resize(1);
327  c[0] = std::pow(a[0], b[0]);
328 }
329 
330 template <typename ordinal_type, typename value_type>
331 void
334  const value_type& a,
336 {
337  if (c.size() < 1)
338  c.resize(1);
339  c[0] = std::pow(a, b[0]);
340 }
341 
342 template <typename ordinal_type, typename value_type>
343 void
347  const value_type& b)
348 {
349  if (c.size() < 1)
350  c.resize(1);
351  c[0] = std::pow(a[0], b);
352 }
353 
354 template <typename ordinal_type, typename value_type>
355 void
359 {
360  if (s.size() < 1)
361  s.resize(1);
362  s[0] = std::sin(a[0]);
363 }
364 
365 template <typename ordinal_type, typename value_type>
366 void
370 {
371  if (c.size() < 1)
372  c.resize(1);
373  c[0] = std::cos(a[0]);
374 }
375 
376 template <typename ordinal_type, typename value_type>
377 void
381 {
382  if (t.size() < 1)
383  t.resize(1);
384  t[0] = std::tan(a[0]);
385 }
386 
387 template <typename ordinal_type, typename value_type>
388 void
392 {
393  if (s.size() < 1)
394  s.resize(1);
395  s[0] = std::sinh(a[0]);
396 }
397 
398 template <typename ordinal_type, typename value_type>
399 void
403 {
404  if (c.size() < 1)
405  c.resize(1);
406  c[0] = std::cosh(a[0]);
407 }
408 
409 template <typename ordinal_type, typename value_type>
410 void
414 {
415  if (t.size() < 1)
416  t.resize(1);
417  t[0] = std::tanh(a[0]);
418 }
419 
420 template <typename ordinal_type, typename value_type>
421 void
425 {
426  if (c.size() < 1)
427  c.resize(1);
428  c[0] = std::acos(a[0]);
429 }
430 
431 template <typename ordinal_type, typename value_type>
432 void
436 {
437  if (c.size() < 1)
438  c.resize(1);
439  c[0] = std::asin(a[0]);
440 }
441 
442 template <typename ordinal_type, typename value_type>
443 void
447 {
448  if (c.size() < 1)
449  c.resize(1);
450  c[0] = std::atan(a[0]);
451 }
452 
453 template <typename ordinal_type, typename value_type>
454 void
459 {
460  if (c.size() < 1)
461  c.resize(1);
462  c[0] = std::atan2(a[0], b[0]);
463 }
464 
465 template <typename ordinal_type, typename value_type>
466 void
469  const value_type& a,
471 {
472  if (c.size() < 1)
473  c.resize(1);
474  c[0] = std::atan2(a, b[0]);
475 }
476 
477 template <typename ordinal_type, typename value_type>
478 void
482  const value_type& b)
483 {
484  c[0] = std::atan2(a[0], b);
485 }
486 
487 template <typename ordinal_type, typename value_type>
488 void
492 {
493  if (c.size() < 1)
494  c.resize(1);
495  c[0] = std::log(a[0]+std::sqrt(a[0]*a[0]-value_type(1.0)));
496 }
497 
498 template <typename ordinal_type, typename value_type>
499 void
503 {
504  if (c.size() < 1)
505  c.resize(1);
506  c[0] = std::log(a[0]+std::sqrt(a[0]*a[0]+value_type(1.0)));
507 }
508 
509 template <typename ordinal_type, typename value_type>
510 void
514 {
515  if (c.size() < 1)
516  c.resize(1);
517  c[0] = 0.5*std::log((value_type(1.0)+a[0])/(value_type(1.0)-a[0]));
518 }
519 
520 template <typename ordinal_type, typename value_type>
521 void
525 {
526  if (c.size() < 1)
527  c.resize(1);
528  c[0] = std::fabs(a[0]);
529 }
530 
531 template <typename ordinal_type, typename value_type>
532 void
536 {
537  if (c.size() < 1)
538  c.resize(1);
539  c[0] = std::fabs(a[0]);
540 }
541 
542 template <typename ordinal_type, typename value_type>
543 void
548 {
549  if (c.size() < 1)
550  c.resize(1);
551  c[0] = std::max(a[0], b[0]);
552 }
553 
554 template <typename ordinal_type, typename value_type>
555 void
558  const value_type& a,
560 {
561  if (c.size() < 1)
562  c.resize(1);
563  c[0] = std::max(a, b[0]);
564 }
565 
566 template <typename ordinal_type, typename value_type>
567 void
571  const value_type& b)
572 {
573  if (c.size() < 1)
574  c.resize(1);
575  c[0] = std::max(a[0], b);
576 }
577 
578 template <typename ordinal_type, typename value_type>
579 void
584 {
585  if (c.size() < 1)
586  c.resize(1);
587  c[0] = std::min(a[0], b[0]);
588 }
589 
590 template <typename ordinal_type, typename value_type>
591 void
594  const value_type& a,
596 {
597  if (c.size() < 1)
598  c.resize(1);
599  c[0] = std::min(a, b[0]);
600 }
601 
602 template <typename ordinal_type, typename value_type>
603 void
607  const value_type& b)
608 {
609  if (c.size() < 1)
610  c.resize(1);
611  c[0] = std::min(a[0], b);
612 }
KOKKOS_INLINE_FUNCTION PCE< Storage > sqrt(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > fabs(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > tan(const PCE< Storage > &a)
void cbrt(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void timesEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
KOKKOS_INLINE_FUNCTION PCE< Storage > sinh(const PCE< Storage > &a)
void resize(ordinal_type sz)
Resize coefficient array (coefficients are preserved)
KOKKOS_INLINE_FUNCTION PCE< Storage > pow(const PCE< Storage > &a, const PCE< Storage > &b)
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)
void acosh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void cosh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void cos(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void sin(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
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)
KOKKOS_INLINE_FUNCTION PCE< Storage > tanh(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > cbrt(const PCE< Storage > &a)
void sqrt(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void unaryMinus(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
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)
KOKKOS_INLINE_FUNCTION PCE< Storage > acos(const PCE< Storage > &a)
atan2(expr1.val(), expr2.val())
KOKKOS_INLINE_FUNCTION PCE< Storage > min(const typename PCE< Storage >::value_type &a, const PCE< Storage > &b)
void sinh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void minusEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
void asin(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
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)
KOKKOS_INLINE_FUNCTION PCE< Storage > max(const typename PCE< Storage >::value_type &a, const PCE< Storage > &b)
KOKKOS_INLINE_FUNCTION PCE< Storage > cosh(const PCE< Storage > &a)
void log10(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void tanh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void atan(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void divideEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
void plusEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
void fabs(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void asinh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > atan(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > exp(const PCE< Storage > &a)
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)
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)
Class to store coefficients of a projection onto an orthogonal polynomial basis.
void tan(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
expr val()
void exp(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void abs(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > sin(const PCE< Storage > &a)
ordinal_type size() const
Return size.
void atanh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void atan2(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)
void acos(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > log(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > log10(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > asin(const PCE< Storage > &a)
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)
KOKKOS_INLINE_FUNCTION PCE< Storage > cos(const PCE< Storage > &a)
void log(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)