Stokhos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Stokhos_ConstantOrthogPolyExpansionImp.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
44template <typename ordinal_type, typename value_type>
47{
48}
49
50template <typename ordinal_type, typename value_type>
51void
56{
57 if (c.size() < 1)
58 c.resize(1);
59 c[0] = -a[0];
60}
61
62template <typename ordinal_type, typename value_type>
63void
66 const value_type& val)
67{
68 if (c.size() < 1)
69 c.resize(1);
70 c[0] += val;
71}
72
73template <typename ordinal_type, typename value_type>
74void
77 const value_type& val)
78{
79 if (c.size() < 1)
80 c.resize(1);
81 c[0] -= val;
82}
83
84template <typename ordinal_type, typename value_type>
85void
88 const value_type& val)
89{
90 if (c.size() < 1)
91 c.resize(1);
92 c[0] *= val;
93}
94
95template <typename ordinal_type, typename value_type>
96void
99 const value_type& val)
100{
101 if (c.size() < 1)
102 c.resize(1);
103 c[0] /= val;
104}
105
106template <typename ordinal_type, typename value_type>
107void
112{
113 if (c.size() < 1)
114 c.resize(1);
115 c[0] += x[0];
116}
117
118template <typename ordinal_type, typename value_type>
119void
124{
125 if (c.size() < 1)
126 c.resize(1);
127 c[0] -= x[0];
128}
129
130template <typename ordinal_type, typename value_type>
131void
136{
137 if (c.size() < 1)
138 c.resize(1);
139 c[0] *= x[0];
140}
141
142template <typename ordinal_type, typename value_type>
143void
147{
148 if (c.size() < 1)
149 c.resize(1);
150 c[0] /= x[0];
151}
152
153template <typename ordinal_type, typename value_type>
154void
159{
160 if (c.size() < 1)
161 c.resize(1);
162 c[0] = a[0] + b[0];
163}
164
165template <typename ordinal_type, typename value_type>
166void
169 const value_type& a,
171{
172 if (c.size() < 1)
173 c.resize(1);
174 c[0] = a + b[0];
175}
176
177template <typename ordinal_type, typename value_type>
178void
182 const value_type& b)
183{
184 if (c.size() < 1)
185 c.resize(1);
186 c[0] = a[0] + b;
187}
188
189template <typename ordinal_type, typename value_type>
190void
195{
196 if (c.size() < 1)
197 c.resize(1);
198 c[0] = a[0] - b[0];
199}
200
201template <typename ordinal_type, typename value_type>
202void
205 const value_type& a,
207{
208 if (c.size() < 1)
209 c.resize(1);
210 c[0] = a - b[0];
211}
212
213template <typename ordinal_type, typename value_type>
214void
218 const value_type& b)
219{
220 if (c.size() < 1)
221 c.resize(1);
222 c[0] = a[0] - b;
223}
224
225template <typename ordinal_type, typename value_type>
226void
231{
232 if (c.size() < 1)
233 c.resize(1);
234 c[0] = a[0] * b[0];
235}
236
237template <typename ordinal_type, typename value_type>
238void
241 const value_type& a,
243{
244 if (c.size() < 1)
245 c.resize(1);
246 c[0] = a * b[0];
247}
248
249template <typename ordinal_type, typename value_type>
250void
254 const value_type& b)
255{
256 if (c.size() < 1)
257 c.resize(1);
258 c[0] = a[0] * b;
259}
260
261template <typename ordinal_type, typename value_type>
262void
267{
268 if (c.size() < 1)
269 c.resize(1);
270 c[0] = a[0] / b[0];
271}
272
273template <typename ordinal_type, typename value_type>
274void
277 const value_type& a,
279{
280 if (c.size() < 1)
281 c.resize(1);
282 c[0] = a / b[0];
283}
284
285template <typename ordinal_type, typename value_type>
286void
290 const value_type& b)
291{
292 if (c.size() < 1)
293 c.resize(1);
294 c[0] = a[0] / b;
295}
296
297template <typename ordinal_type, typename value_type>
298void
302{
303 if (c.size() < 1)
304 c.resize(1);
305 c[0] = std::exp(a[0]);
306}
307
308template <typename ordinal_type, typename value_type>
309void
313{
314 if (c.size() < 1)
315 c.resize(1);
316 c[0] = std::log(a[0]);
317}
318
319template <typename ordinal_type, typename value_type>
320void
324{
325 if (c.size() < 1)
326 c.resize(1);
327 c[0] = std::log10(a[0]);
328}
329
330template <typename ordinal_type, typename value_type>
331void
335{
336 if (c.size() < 1)
337 c.resize(1);
338 c[0] = std::sqrt(a[0]);
339}
340
341template <typename ordinal_type, typename value_type>
342void
346{
347 if (c.size() < 1)
348 c.resize(1);
349 c[0] = std::cbrt(a[0]);
350}
351
352template <typename ordinal_type, typename value_type>
353void
358{
359 if (c.size() < 1)
360 c.resize(1);
361 c[0] = std::pow(a[0], b[0]);
362}
363
364template <typename ordinal_type, typename value_type>
365void
368 const value_type& a,
370{
371 if (c.size() < 1)
372 c.resize(1);
373 c[0] = std::pow(a, b[0]);
374}
375
376template <typename ordinal_type, typename value_type>
377void
381 const value_type& b)
382{
383 if (c.size() < 1)
384 c.resize(1);
385 c[0] = std::pow(a[0], b);
386}
387
388template <typename ordinal_type, typename value_type>
389void
393{
394 if (s.size() < 1)
395 s.resize(1);
396 s[0] = std::sin(a[0]);
397}
398
399template <typename ordinal_type, typename value_type>
400void
404{
405 if (c.size() < 1)
406 c.resize(1);
407 c[0] = std::cos(a[0]);
408}
409
410template <typename ordinal_type, typename value_type>
411void
415{
416 if (t.size() < 1)
417 t.resize(1);
418 t[0] = std::tan(a[0]);
419}
420
421template <typename ordinal_type, typename value_type>
422void
426{
427 if (s.size() < 1)
428 s.resize(1);
429 s[0] = std::sinh(a[0]);
430}
431
432template <typename ordinal_type, typename value_type>
433void
437{
438 if (c.size() < 1)
439 c.resize(1);
440 c[0] = std::cosh(a[0]);
441}
442
443template <typename ordinal_type, typename value_type>
444void
448{
449 if (t.size() < 1)
450 t.resize(1);
451 t[0] = std::tanh(a[0]);
452}
453
454template <typename ordinal_type, typename value_type>
455void
459{
460 if (c.size() < 1)
461 c.resize(1);
462 c[0] = std::acos(a[0]);
463}
464
465template <typename ordinal_type, typename value_type>
466void
470{
471 if (c.size() < 1)
472 c.resize(1);
473 c[0] = std::asin(a[0]);
474}
475
476template <typename ordinal_type, typename value_type>
477void
481{
482 if (c.size() < 1)
483 c.resize(1);
484 c[0] = std::atan(a[0]);
485}
486
487template <typename ordinal_type, typename value_type>
488void
493{
494 if (c.size() < 1)
495 c.resize(1);
496 c[0] = std::atan2(a[0], b[0]);
497}
498
499template <typename ordinal_type, typename value_type>
500void
503 const value_type& a,
505{
506 if (c.size() < 1)
507 c.resize(1);
508 c[0] = std::atan2(a, b[0]);
509}
510
511template <typename ordinal_type, typename value_type>
512void
516 const value_type& b)
517{
518 c[0] = std::atan2(a[0], b);
519}
520
521template <typename ordinal_type, typename value_type>
522void
526{
527 if (c.size() < 1)
528 c.resize(1);
529 c[0] = std::log(a[0]+std::sqrt(a[0]*a[0]-value_type(1.0)));
530}
531
532template <typename ordinal_type, typename value_type>
533void
537{
538 if (c.size() < 1)
539 c.resize(1);
540 c[0] = std::log(a[0]+std::sqrt(a[0]*a[0]+value_type(1.0)));
541}
542
543template <typename ordinal_type, typename value_type>
544void
548{
549 if (c.size() < 1)
550 c.resize(1);
551 c[0] = 0.5*std::log((value_type(1.0)+a[0])/(value_type(1.0)-a[0]));
552}
553
554template <typename ordinal_type, typename value_type>
555void
559{
560 if (c.size() < 1)
561 c.resize(1);
562 c[0] = std::fabs(a[0]);
563}
564
565template <typename ordinal_type, typename value_type>
566void
570{
571 if (c.size() < 1)
572 c.resize(1);
573 c[0] = std::fabs(a[0]);
574}
575
576template <typename ordinal_type, typename value_type>
577void
582{
583 if (c.size() < 1)
584 c.resize(1);
585 c[0] = std::max(a[0], b[0]);
586}
587
588template <typename ordinal_type, typename value_type>
589void
592 const value_type& a,
594{
595 if (c.size() < 1)
596 c.resize(1);
597 c[0] = std::max(a, b[0]);
598}
599
600template <typename ordinal_type, typename value_type>
601void
605 const value_type& b)
606{
607 if (c.size() < 1)
608 c.resize(1);
609 c[0] = std::max(a[0], b);
610}
611
612template <typename ordinal_type, typename value_type>
613void
618{
619 if (c.size() < 1)
620 c.resize(1);
621 c[0] = std::min(a[0], b[0]);
622}
623
624template <typename ordinal_type, typename value_type>
625void
628 const value_type& a,
630{
631 if (c.size() < 1)
632 c.resize(1);
633 c[0] = std::min(a, b[0]);
634}
635
636template <typename ordinal_type, typename value_type>
637void
641 const value_type& b)
642{
643 if (c.size() < 1)
644 c.resize(1);
645 c[0] = std::min(a[0], b);
646}
expr val()
void cosh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
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)
void log10(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void acosh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
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)
void abs(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 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 sinh(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)
void atan(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void atanh(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)
void fabs(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void tan(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void acos(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void plusEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
void exp(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 unaryMinus(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 divideEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
void tanh(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)
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 timesEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
void log(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void sqrt(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 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)
void cbrt(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
Class to store coefficients of a projection onto an orthogonal polynomial basis.
void resize(ordinal_type sz)
Resize coefficient array (coefficients are preserved)
ordinal_type size() const
Return size.