Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_PseudoSpectralExpansionUnitTest.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 namespace PseudoSpectralExpansionUnitTest {
11 
12  template <class Func, typename OrdinalType, typename ValueType>
16  {
17  // Basis
19  = a.basis();
20 
21  // Quadrature data
22  const Teuchos::Array<ValueType>& weights = quad.getQuadWeights();
24  quad.getQuadPoints();
26  quad.getBasisAtQuadPoints();
27  OrdinalType nqp = weights.size();
28 
29  // Initialize
30  for (OrdinalType i=0; i<c.size(); i++)
31  c[i] = 0.0;
32 
33  // Compute PCE via quadrature
34  Func func;
35  for (OrdinalType k=0; k<nqp; k++) {
36  ValueType val = a.evaluate(points[k], values[k]);
37  val = func(val);
38  for (int i=0; i<c.size(); i++)
39  c[i] += weights[k]*val*values[k][i] / basis->norm_squared(i);
40  }
41  }
42 
43  template <class Func, typename OrdinalType, typename ValueType>
48  {
49  // Basis
51  = a.basis();
52 
53  // Quadrature data
54  const Teuchos::Array<ValueType>& weights = quad.getQuadWeights();
56  quad.getQuadPoints();
58  quad.getBasisAtQuadPoints();
59  OrdinalType nqp = weights.size();
60 
61  // Initialize
62  for (OrdinalType i=0; i<c.size(); i++)
63  c[i] = 0.0;
64 
65  // Compute PCE via quadrature
66  Func func;
67  for (OrdinalType k=0; k<nqp; k++) {
68  ValueType val1 = a.evaluate(points[k], values[k]);
69  ValueType val2 = b.evaluate(points[k], values[k]);
70  ValueType val = func(val1, val2);
71  for (int i=0; i<c.size(); i++)
72  c[i] += weights[k]*val*values[k][i] / basis->norm_squared(i);
73  }
74  }
75 
76  template <class Func, typename OrdinalType, typename ValueType>
79  ValueType a,
82  {
83  // Basis
85  = b.basis();
86 
87  // Quadrature data
88  const Teuchos::Array<ValueType>& weights = quad.getQuadWeights();
90  quad.getQuadPoints();
92  quad.getBasisAtQuadPoints();
93  OrdinalType nqp = weights.size();
94 
95  // Initialize
96  for (OrdinalType i=0; i<c.size(); i++)
97  c[i] = 0.0;
98 
99  // Compute PCE via quadrature
100  Func func;
101  for (OrdinalType k=0; k<nqp; k++) {
102  ValueType val2 = b.evaluate(points[k], values[k]);
103  ValueType val = func(a, val2);
104  for (int i=0; i<c.size(); i++)
105  c[i] += weights[k]*val*values[k][i] / basis->norm_squared(i);
106  }
107  }
108 
109  template <class Func, typename OrdinalType, typename ValueType>
113  ValueType b,
115  {
116  // Basis
118  = a.basis();
119 
120  // Quadrature data
121  const Teuchos::Array<ValueType>& weights = quad.getQuadWeights();
123  quad.getQuadPoints();
125  quad.getBasisAtQuadPoints();
126  OrdinalType nqp = weights.size();
127 
128  // Initialize
129  for (OrdinalType i=0; i<c.size(); i++)
130  c[i] = 0.0;
131 
132  // Compute PCE via quadrature
133  Func func;
134  for (OrdinalType k=0; k<nqp; k++) {
135  ValueType val1 = a.evaluate(points[k], values[k]);
136  ValueType val = func(val1, b);
137  for (int i=0; i<c.size(); i++)
138  c[i] += weights[k]*val*values[k][i] / basis->norm_squared(i);
139  }
140  }
141 
142  struct UMinusFunc {
143  double operator() (double a) const { return -a; }
144  };
145  struct ExpFunc {
146  double operator() (double a) const { return std::exp(a); }
147  };
148  struct LogFunc {
149  double operator() (double a) const { return std::log(a); }
150  };
151  struct Log10Func {
152  double operator() (double a) const { return std::log10(a); }
153  };
154  struct SqrtFunc {
155  double operator() (double a) const { return std::sqrt(a); }
156  };
157  struct CbrtFunc {
158  double operator() (double a) const { return std::cbrt(a); }
159  };
160  struct SinFunc {
161  double operator() (double a) const { return std::sin(a); }
162  };
163  struct CosFunc {
164  double operator() (double a) const { return std::cos(a); }
165  };
166  struct TanFunc {
167  double operator() (double a) const { return std::tan(a); }
168  };
169  struct SinhFunc {
170  double operator() (double a) const { return std::sinh(a); }
171  };
172  struct CoshFunc {
173  double operator() (double a) const { return std::cosh(a); }
174  };
175  struct TanhFunc {
176  double operator() (double a) const { return std::tanh(a); }
177  };
178  struct ASinFunc {
179  double operator() (double a) const { return std::asin(a); }
180  };
181  struct ACosFunc {
182  double operator() (double a) const { return std::acos(a); }
183  };
184  struct ATanFunc {
185  double operator() (double a) const { return std::atan(a); }
186  };
187  struct ASinhFunc {
188  double operator() (double a) const {
189  return std::log(a+std::sqrt(a*a+1.0));
190  }
191  };
192  struct ACoshFunc {
193  double operator() (double a) const {
194  return std::log(a+std::sqrt(a*a-1.0));
195  }
196  };
197  struct ATanhFunc {
198  double operator() (double a) const {
199  return 0.5*std::log((1.0+a)/(1.0-a));
200  }
201  };
202 
203  struct PlusFunc {
204  double operator() (double a, double b) const { return a + b; }
205  };
206  struct MinusFunc {
207  double operator() (double a, double b) const { return a - b; }
208  };
209  struct TimesFunc {
210  double operator() (double a, double b) const { return a * b; }
211  };
212  struct DivideFunc {
213  double operator() (double a, double b) const { return a / b; }
214  };
215  struct PowFunc {
216  double operator() (double a, double b) const { return std::pow(a,b); }
217  };
218 
219  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, UMinus ) {
221  setup.exp->sin(v, setup.x);
222  setup.exp->unaryMinus(setup.u, v);
223  computePCE1<UMinusFunc>(setup.u2, v, *setup.quad);
224  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
225  setup.rtol, setup.atol, out);
226  }
227  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Exp ) {
228  setup.exp->exp(setup.u, setup.x);
229  computePCE1<ExpFunc>(setup.u2, setup.x, *setup.quad);
230  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
231  setup.rtol, setup.atol, out);
232  }
233  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ExpConst ) {
234  setup.exp->exp(setup.cu, setup.cx);
235  setup.cu2[0] = std::exp(setup.cx[0]);
236  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
237  setup.crtol, setup.catol, out);
238  }
239  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ExpResize ) {
241  setup.exp->exp(ru, setup.x);
242  computePCE1<ExpFunc>(setup.u2, setup.x, *setup.quad);
243  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
244  setup.rtol, setup.atol, out);
245  }
246  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Log ) {
247  setup.exp->log(setup.u, setup.x);
248  computePCE1<LogFunc>(setup.u2, setup.x, *setup.quad);
249  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
250  setup.rtol, setup.atol, out);
251  }
252  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, LogConst ) {
253  setup.exp->log(setup.cu, setup.cx);
254  setup.cu2[0] = std::log(setup.cx[0]);
255  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
256  setup.crtol, setup.catol, out);
257  }
258  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, LogResize ) {
260  setup.exp->log(ru, setup.x);
261  computePCE1<LogFunc>(setup.u2, setup.x, *setup.quad);
262  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
263  setup.rtol, setup.atol, out);
264  }
265  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Log10 ) {
266  setup.exp->log10(setup.u, setup.x);
267  computePCE1<Log10Func>(setup.u2, setup.x, *setup.quad);
268  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
269  setup.rtol, setup.atol, out);
270  }
271  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Log10Const ) {
272  setup.exp->log10(setup.cu, setup.cx);
273  setup.cu2[0] = std::log10(setup.cx[0]);
274  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
275  setup.crtol, setup.catol, out);
276  }
277  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Log10Resize ) {
279  setup.exp->log10(ru, setup.x);
280  computePCE1<Log10Func>(setup.u2, setup.x, *setup.quad);
281  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
282  setup.rtol, setup.atol, out);
283  }
284  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Sqrt ) {
285  setup.exp->sqrt(setup.u, setup.x);
286  computePCE1<SqrtFunc>(setup.u2, setup.x, *setup.quad);
287  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
288  setup.rtol, setup.atol, out);
289  }
290  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, SqrtConst ) {
291  setup.exp->sqrt(setup.cu, setup.cx);
292  setup.cu2[0] = std::sqrt(setup.cx[0]);
293  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
294  setup.crtol, setup.catol, out);
295  }
296  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, SqrtResize ) {
298  setup.exp->sqrt(ru, setup.x);
299  computePCE1<SqrtFunc>(setup.u2, setup.x, *setup.quad);
300  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
301  setup.rtol, setup.atol, out);
302  }
303  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Cbrt ) {
304  setup.exp->cbrt(setup.u, setup.x);
305  computePCE1<CbrtFunc>(setup.u2, setup.x, *setup.quad);
306  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
307  setup.rtol, setup.atol, out);
308  }
309  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, CbrtConst ) {
310  setup.exp->cbrt(setup.cu, setup.cx);
311  setup.cu2[0] = std::cbrt(setup.cx[0]);
312  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
313  setup.crtol, setup.catol, out);
314  }
315  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, CbrtResize ) {
317  setup.exp->cbrt(ru, setup.x);
318  computePCE1<CbrtFunc>(setup.u2, setup.x, *setup.quad);
319  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
320  setup.rtol, setup.atol, out);
321  }
322  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Sin ) {
323  setup.exp->sin(setup.u, setup.x);
324  computePCE1<SinFunc>(setup.u2, setup.x, *setup.quad);
325  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
326  setup.rtol, setup.atol, out);
327  }
328  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, SinConst ) {
329  setup.exp->sin(setup.cu, setup.cx);
330  setup.cu2[0] = std::sin(setup.cx[0]);
331  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
332  setup.crtol, setup.catol, out);
333  }
334  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, SinResize ) {
336  setup.exp->sin(ru, setup.x);
337  computePCE1<SinFunc>(setup.u2, setup.x, *setup.quad);
338  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
339  setup.rtol, setup.atol, out);
340  }
341  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Cos ) {
342  setup.exp->cos(setup.u, setup.x);
343  computePCE1<CosFunc>(setup.u2, setup.x, *setup.quad);
344  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
345  setup.rtol, setup.atol, out);
346  }
347  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, CosConst ) {
348  setup.exp->cos(setup.cu, setup.cx);
349  setup.cu2[0] = std::cos(setup.cx[0]);
350  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
351  setup.crtol, setup.catol, out);
352  }
353  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, CosResize ) {
355  setup.exp->cos(ru, setup.x);
356  computePCE1<CosFunc>(setup.u2, setup.x, *setup.quad);
357  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
358  setup.rtol, setup.atol, out);
359  }
360  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Tan ) {
361  setup.exp->tan(setup.u, setup.x);
362  computePCE1<TanFunc>(setup.u2, setup.x, *setup.quad);
363  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
364  setup.rtol, setup.atol, out);
365  }
366  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TanConst ) {
367  setup.exp->tan(setup.cu, setup.cx);
368  setup.cu2[0] = std::tan(setup.cx[0]);
369  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
370  setup.crtol, setup.catol, out);
371  }
372  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TanResize ) {
374  setup.exp->tan(ru, setup.x);
375  computePCE1<TanFunc>(setup.u2, setup.x, *setup.quad);
376  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
377  setup.rtol, setup.atol, out);
378  }
379  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Sinh ) {
380  setup.exp->sinh(setup.u, setup.x);
381  computePCE1<SinhFunc>(setup.u2, setup.x, *setup.quad);
382  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
383  setup.rtol, setup.atol, out);
384  }
385  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, SinhConst ) {
386  setup.exp->sinh(setup.cu, setup.cx);
387  setup.cu2[0] = std::sinh(setup.cx[0]);
388  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
389  setup.crtol, setup.catol, out);
390  }
391  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, SinhResize ) {
393  setup.exp->sinh(ru, setup.x);
394  computePCE1<SinhFunc>(setup.u2, setup.x, *setup.quad);
395  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
396  setup.rtol, setup.atol, out);
397  }
398  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Cosh ) {
399  setup.exp->cosh(setup.u, setup.x);
400  computePCE1<CoshFunc>(setup.u2, setup.x, *setup.quad);
401  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
402  setup.rtol, setup.atol, out);
403  }
404  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, CoshConst ) {
405  setup.exp->cosh(setup.cu, setup.cx);
406  setup.cu2[0] = std::cosh(setup.cx[0]);
407  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
408  setup.crtol, setup.catol, out);
409  }
410  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, CoshResize ) {
412  setup.exp->cosh(ru, setup.x);
413  computePCE1<CoshFunc>(setup.u2, setup.x, *setup.quad);
414  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
415  setup.rtol, setup.atol, out);
416  }
417  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Tanh ) {
418  setup.exp->tanh(setup.u, setup.x);
419  computePCE1<TanhFunc>(setup.u2, setup.x, *setup.quad);
420  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
421  setup.rtol, setup.atol, out);
422  }
423  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TanhConst ) {
424  setup.exp->tanh(setup.cu, setup.cx);
425  setup.cu2[0] = std::tanh(setup.cx[0]);
426  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
427  setup.crtol, setup.catol, out);
428  }
429  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TanhResize ) {
431  setup.exp->tanh(ru, setup.x);
432  computePCE1<TanhFunc>(setup.u2, setup.x, *setup.quad);
433  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
434  setup.rtol, setup.atol, out);
435  }
436  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ASin ) {
437  setup.exp->asin(setup.u, setup.x);
438  computePCE1<ASinFunc>(setup.u2, setup.x, *setup.quad);
439  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
440  setup.rtol, setup.atol, out);
441  }
442  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ASinConst ) {
443  setup.exp->asin(setup.cu, setup.cx);
444  setup.cu2[0] = std::asin(setup.cx[0]);
445  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
446  setup.crtol, setup.catol, out);
447  }
448  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ASinResize ) {
450  setup.exp->asin(ru, setup.x);
451  computePCE1<ASinFunc>(setup.u2, setup.x, *setup.quad);
452  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
453  setup.rtol, setup.atol, out);
454  }
455  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ACos ) {
456  setup.exp->acos(setup.u, setup.x);
457  computePCE1<ACosFunc>(setup.u2, setup.x, *setup.quad);
458  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
459  setup.rtol, setup.atol, out);
460  }
461  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ACosConst ) {
462  setup.exp->acos(setup.cu, setup.cx);
463  setup.cu2[0] = std::acos(setup.cx[0]);
464  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
465  setup.crtol, setup.catol, out);
466  }
467  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ACosResize ) {
469  setup.exp->acos(ru, setup.x);
470  computePCE1<ACosFunc>(setup.u2, setup.x, *setup.quad);
471  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
472  setup.rtol, setup.atol, out);
473  }
474  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ATan ) {
475  setup.exp->atan(setup.u, setup.x);
476  computePCE1<ATanFunc>(setup.u2, setup.x, *setup.quad);
477  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
478  setup.rtol, setup.atol, out);
479  }
480  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ATanConst ) {
481  setup.exp->atan(setup.cu, setup.cx);
482  setup.cu2[0] = std::atan(setup.cx[0]);
483  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
484  setup.crtol, setup.catol, out);
485  }
486  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ATanResize ) {
488  setup.exp->atan(ru, setup.x);
489  computePCE1<ATanFunc>(setup.u2, setup.x, *setup.quad);
490  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
491  setup.rtol, setup.atol, out);
492  }
493  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ASinh ) {
494  setup.exp->asinh(setup.u, setup.x);
495  computePCE1<ASinhFunc>(setup.u2, setup.x, *setup.quad);
496  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
497  setup.rtol, setup.atol, out);
498  }
499  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ASinhConst ) {
500  ASinhFunc f;
501  setup.exp->asinh(setup.cu, setup.cx);
502  setup.cu2[0] = f(setup.cx[0]);
503  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
504  setup.crtol, setup.catol, out);
505  }
506  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ASinhResize ) {
508  setup.exp->asinh(ru, setup.x);
509  computePCE1<ASinhFunc>(setup.u2, setup.x, *setup.quad);
510  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
511  setup.rtol, setup.atol, out);
512  }
513  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ACosh ) {
514  setup.exp->acosh(setup.u, setup.x);
515  computePCE1<ACoshFunc>(setup.u2, setup.x, *setup.quad);
516  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
517  setup.rtol, setup.atol, out);
518  }
519  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ACoshConst ) {
520  ACoshFunc f;
521  setup.exp->acosh(setup.cu, setup.cx);
522  setup.cu2[0] = f(setup.cx[0]);
523  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
524  setup.crtol, setup.catol, out);
525  }
526  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ACoshResize ) {
528  setup.exp->acosh(ru, setup.x);
529  computePCE1<ACoshFunc>(setup.u2, setup.x, *setup.quad);
530  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
531  setup.rtol, setup.atol, out);
532  }
533  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ATanh ) {
534  setup.exp->atanh(setup.u, setup.x);
535  computePCE1<ATanhFunc>(setup.u2, setup.x, *setup.quad);
536  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
537  setup.rtol, setup.atol, out);
538  }
539  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ATanhConst ) {
540  ATanhFunc f;
541  setup.exp->atanh(setup.cu, setup.cx);
542  setup.cu2[0] = f(setup.cx[0]);
543  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
544  setup.crtol, setup.catol, out);
545  }
546  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, ATanhResize ) {
548  setup.exp->atanh(ru, setup.x);
549  computePCE1<ATanhFunc>(setup.u2, setup.x, *setup.quad);
550  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
551  setup.rtol, setup.atol, out);
552  }
553 
554  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Plus ) {
556  setup.exp->sin(v, setup.x);
557  setup.exp->cos(w, setup.y);
558  setup.exp->plus(setup.u, v, w);
559  computePCE2<PlusFunc>(setup.u2, v, w, *setup.quad);
560  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
561  setup.rtol, setup.atol, out);
562  }
563  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusLC ) {
565  setup.exp->sin(v, setup.x);
566  setup.exp->plus(setup.u, setup.a, v);
567  computePCE2LC<PlusFunc>(setup.u2, setup.a, v, *setup.quad);
568  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
569  setup.rtol, setup.atol, out);
570  }
571  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusRC ) {
573  setup.exp->sin(v, setup.x);
574  setup.exp->plus(setup.u, v, setup.a);
575  computePCE2RC<PlusFunc>(setup.u2, v, setup.a, *setup.quad);
576  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
577  setup.rtol, setup.atol, out);
578  }
579  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusCC ) {
580  setup.exp->plus(setup.cu, setup.cx, setup.cx);
581  computePCE2<PlusFunc>(setup.cu2, setup.cx, setup.cx, *setup.quad);
582  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
583  setup.rtol, setup.atol, out);
584  }
585  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusLC2 ) {
587  setup.exp->sin(v, setup.x);
588  setup.exp->plus(setup.u, setup.cx, v);
589  computePCE2LC<PlusFunc>(setup.u2, setup.cx[0], v, *setup.quad);
590  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
591  setup.rtol, setup.atol, out);
592  }
593  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusRC2 ) {
595  setup.exp->sin(v, setup.x);
596  setup.exp->plus(setup.u, v, setup.cx);
597  computePCE2RC<PlusFunc>(setup.u2, v, setup.cx[0], *setup.quad);
598  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
599  setup.rtol, setup.atol, out);
600  }
601  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusResize ) {
604  setup.exp->sin(v, setup.x);
605  setup.exp->cos(w, setup.y);
606  setup.exp->plus(ru, v, w);
607  computePCE2<PlusFunc>(setup.u2, v, w, *setup.quad);
608  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
609  setup.rtol, setup.atol, out);
610  }
611  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusLCResize ) {
614  setup.exp->sin(v, setup.x);
615  setup.exp->plus(ru, setup.a, v);
616  computePCE2LC<PlusFunc>(setup.u2, setup.a, v, *setup.quad);
617  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
618  setup.rtol, setup.atol, out);
619  }
620  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusRCResize ) {
623  setup.exp->sin(v, setup.x);
624  setup.exp->plus(ru, v, setup.a);
625  computePCE2RC<PlusFunc>(setup.u2, v, setup.a, *setup.quad);
626  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
627  setup.rtol, setup.atol, out);
628  }
629  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusLS ) {
631  setup.exp->sin(v, setup.x);
632  setup.exp->plus(setup.u, setup.sx, v);
633  computePCE2<PlusFunc>(setup.u2, setup.sx, v, *setup.quad);
634  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
635  setup.rtol, setup.atol, out);
636  }
637  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusRS ) {
639  setup.exp->sin(v, setup.x);
640  setup.exp->plus(setup.u, v, setup.sx);
641  computePCE2<PlusFunc>(setup.u2, v, setup.sx, *setup.quad);
642  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
643  setup.rtol, setup.atol, out);
644  }
645  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusLSRC ) {
646  setup.exp->plus(setup.su, setup.sx, setup.a);
647  computePCE2RC<PlusFunc>(setup.su2, setup.sx, setup.a, *setup.quad);
648  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
649  setup.rtol, setup.atol, out);
650  }
651  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusRSLC ) {
652  setup.exp->plus(setup.su, setup.a, setup.sx);
653  computePCE2LC<PlusFunc>(setup.su2, setup.a, setup.sx, *setup.quad);
654  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
655  setup.rtol, setup.atol, out);
656  }
657  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusLSRC2 ) {
658  setup.exp->plus(setup.su, setup.sx, setup.cx);
659  computePCE2<PlusFunc>(setup.su2, setup.sx, setup.cx, *setup.quad);
660  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
661  setup.rtol, setup.atol, out);
662  }
663  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusRSLC2 ) {
664  setup.exp->plus(setup.su, setup.cx, setup.sx);
665  computePCE2<PlusFunc>(setup.su2, setup.cx, setup.sx, *setup.quad);
666  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
667  setup.rtol, setup.atol, out);
668  }
669 
670  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Minus ) {
672  setup.exp->sin(v, setup.x);
673  setup.exp->cos(w, setup.y);
674  setup.exp->minus(setup.u, v, w);
675  computePCE2<MinusFunc>(setup.u2, v, w, *setup.quad);
676  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
677  setup.rtol, setup.atol, out);
678  }
679  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusLC ) {
681  setup.exp->sin(v, setup.x);
682  setup.exp->minus(setup.u, setup.a, v);
683  computePCE2LC<MinusFunc>(setup.u2, setup.a, v, *setup.quad);
684  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
685  setup.rtol, setup.atol, out);
686  }
687  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusRC ) {
689  setup.exp->sin(v, setup.x);
690  setup.exp->minus(setup.u, v, setup.a);
691  computePCE2RC<MinusFunc>(setup.u2, v, setup.a, *setup.quad);
692  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
693  setup.rtol, setup.atol, out);
694  }
695  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusCC ) {
696  setup.exp->minus(setup.cu, setup.cx, setup.cx);
697  computePCE2<MinusFunc>(setup.cu2, setup.cx, setup.cx, *setup.quad);
698  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
699  setup.rtol, setup.atol, out);
700  }
701  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusLC2 ) {
703  setup.exp->sin(v, setup.x);
704  setup.exp->minus(setup.u, setup.cx, v);
705  computePCE2LC<MinusFunc>(setup.u2, setup.cx[0], v, *setup.quad);
706  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
707  setup.rtol, setup.atol, out);
708  }
709  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusRC2 ) {
711  setup.exp->sin(v, setup.x);
712  setup.exp->minus(setup.u, v, setup.cx);
713  computePCE2RC<MinusFunc>(setup.u2, v, setup.cx[0], *setup.quad);
714  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
715  setup.rtol, setup.atol, out);
716  }
717  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusResize ) {
720  setup.exp->sin(v, setup.x);
721  setup.exp->cos(w, setup.y);
722  setup.exp->minus(ru, v, w);
723  computePCE2<MinusFunc>(setup.u2, v, w, *setup.quad);
724  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
725  setup.rtol, setup.atol, out);
726  }
727  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusLCResize ) {
730  setup.exp->sin(v, setup.x);
731  setup.exp->minus(ru, setup.a, v);
732  computePCE2LC<MinusFunc>(setup.u2, setup.a, v, *setup.quad);
733  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
734  setup.rtol, setup.atol, out);
735  }
736  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusRCResize ) {
739  setup.exp->sin(v, setup.x);
740  setup.exp->minus(ru, v, setup.a);
741  computePCE2RC<MinusFunc>(setup.u2, v, setup.a, *setup.quad);
742  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
743  setup.rtol, setup.atol, out);
744  }
745  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusLS ) {
747  setup.exp->sin(v, setup.x);
748  setup.exp->minus(setup.u, setup.sx, v);
749  computePCE2<MinusFunc>(setup.u2, setup.sx, v, *setup.quad);
750  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
751  setup.rtol, setup.atol, out);
752  }
753  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusRS ) {
755  setup.exp->sin(v, setup.x);
756  setup.exp->minus(setup.u, v, setup.sx);
757  computePCE2<MinusFunc>(setup.u2, v, setup.sx, *setup.quad);
758  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
759  setup.rtol, setup.atol, out);
760  }
761  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusLSRC ) {
762  setup.exp->minus(setup.su, setup.sx, setup.a);
763  computePCE2RC<MinusFunc>(setup.su2, setup.sx, setup.a, *setup.quad);
764  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
765  setup.rtol, setup.atol, out);
766  }
767  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusRSLC ) {
768  setup.exp->minus(setup.su, setup.a, setup.sx);
769  computePCE2LC<MinusFunc>(setup.su2, setup.a, setup.sx, *setup.quad);
770  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
771  setup.rtol, setup.atol, out);
772  }
773  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusLSRC2 ) {
774  setup.exp->minus(setup.su, setup.sx, setup.cx);
775  computePCE2<MinusFunc>(setup.su2, setup.sx, setup.cx, *setup.quad);
776  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
777  setup.rtol, setup.atol, out);
778  }
779  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusRSLC2 ) {
780  setup.exp->minus(setup.su, setup.cx, setup.sx);
781  computePCE2<MinusFunc>(setup.su2, setup.cx, setup.sx, *setup.quad);
782  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
783  setup.rtol, setup.atol, out);
784  }
785 
786  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Times ) {
788  setup.exp->sin(v, setup.x);
789  setup.exp->cos(w, setup.y);
790  setup.exp->times(setup.u, v, w);
791  computePCE2<TimesFunc>(setup.u2, v, w, *setup.quad);
792  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
793  setup.rtol, setup.atol, out);
794  }
795  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesLC ) {
797  setup.exp->sin(v, setup.x);
798  setup.exp->times(setup.u, setup.a, v);
799  computePCE2LC<TimesFunc>(setup.u2, setup.a, v, *setup.quad);
800  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
801  setup.rtol, setup.atol, out);
802  }
803  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesRC ) {
805  setup.exp->sin(v, setup.x);
806  setup.exp->times(setup.u, v, setup.a);
807  computePCE2RC<TimesFunc>(setup.u2, v, setup.a, *setup.quad);
808  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
809  setup.rtol, setup.atol, out);
810  }
811  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesCC ) {
812  setup.exp->times(setup.cu, setup.cx, setup.cx);
813  computePCE2<TimesFunc>(setup.cu2, setup.cx, setup.cx, *setup.quad);
814  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
815  setup.rtol, setup.atol, out);
816  }
817  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesLC2 ) {
819  setup.exp->sin(v, setup.x);
820  setup.exp->times(setup.u, setup.cx, v);
821  computePCE2LC<TimesFunc>(setup.u2, setup.cx[0], v, *setup.quad);
822  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
823  setup.rtol, setup.atol, out);
824  }
825  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesRC2 ) {
827  setup.exp->sin(v, setup.x);
828  setup.exp->times(setup.u, v, setup.cx);
829  computePCE2RC<TimesFunc>(setup.u2, v, setup.cx[0], *setup.quad);
830  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
831  setup.rtol, setup.atol, out);
832  }
833  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesResize ) {
836  setup.exp->sin(v, setup.x);
837  setup.exp->cos(w, setup.y);
838  setup.exp->times(ru, v, w);
839  computePCE2<TimesFunc>(setup.u2, v, w, *setup.quad);
840  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
841  setup.rtol, setup.atol, out);
842  }
843  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesLCResize ) {
846  setup.exp->sin(v, setup.x);
847  setup.exp->times(ru, setup.a, v);
848  computePCE2LC<TimesFunc>(setup.u2, setup.a, v, *setup.quad);
849  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
850  setup.rtol, setup.atol, out);
851  }
852  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesRCResize ) {
855  setup.exp->sin(v, setup.x);
856  setup.exp->times(ru, v, setup.a);
857  computePCE2RC<TimesFunc>(setup.u2, v, setup.a, *setup.quad);
858  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
859  setup.rtol, setup.atol, out);
860  }
861  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesLS ) {
863  setup.exp->sin(v, setup.x);
864  setup.exp->times(setup.u, setup.sx, v);
865  computePCE2<TimesFunc>(setup.u2, setup.sx, v, *setup.quad);
866  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
867  setup.rtol, setup.atol, out);
868  }
869  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesRS ) {
871  setup.exp->sin(v, setup.x);
872  setup.exp->times(setup.u, v, setup.sx);
873  computePCE2<TimesFunc>(setup.u2, v, setup.sx, *setup.quad);
874  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
875  setup.rtol, setup.atol, out);
876  }
877  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesLSLinear ) {
879  setup.exp->sin(v, setup.x);
880  setup.exp_linear->times(setup.u, setup.sx, v);
881  computePCE2<TimesFunc>(setup.u2, setup.sx, v, *setup.quad);
882  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
883  setup.rtol, setup.atol, out);
884  }
885  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesRSLinear ) {
887  setup.exp->sin(v, setup.x);
888  setup.exp_linear->times(setup.u, v, setup.sx);
889  computePCE2<TimesFunc>(setup.u2, v, setup.sx, *setup.quad);
890  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
891  setup.rtol, setup.atol, out);
892  }
893  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesLSRC ) {
894  setup.exp->times(setup.su, setup.sx, setup.a);
895  computePCE2RC<TimesFunc>(setup.su2, setup.sx, setup.a, *setup.quad);
896  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
897  setup.rtol, setup.atol, out);
898  }
899  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesRSLC ) {
900  setup.exp->times(setup.su, setup.a, setup.sx);
901  computePCE2LC<TimesFunc>(setup.su2, setup.a, setup.sx, *setup.quad);
902  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
903  setup.rtol, setup.atol, out);
904  }
905  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesLSRC2 ) {
906  setup.exp->times(setup.su, setup.sx, setup.cx);
907  computePCE2<TimesFunc>(setup.su2, setup.sx, setup.cx, *setup.quad);
908  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
909  setup.rtol, setup.atol, out);
910  }
911  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesRSLC2 ) {
912  setup.exp->times(setup.su, setup.cx, setup.sx);
913  computePCE2<TimesFunc>(setup.su2, setup.cx, setup.sx, *setup.quad);
914  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
915  setup.rtol, setup.atol, out);
916  }
917 
918  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Divide ) {
920  setup.exp->sin(v, setup.x);
921  setup.exp->exp(w, setup.y);
922  setup.exp->divide(setup.u, v, w);
923  computePCE2<DivideFunc>(setup.u2, v, w, *setup.quad);
924  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
925  setup.rtol, setup.atol, out);
926  }
927  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideLC ) {
929  setup.exp->sin(v, setup.x);
930  setup.exp->divide(setup.u, setup.a, v);
931  computePCE2LC<DivideFunc>(setup.u2, setup.a, v, *setup.quad);
932  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
933  setup.rtol, setup.atol, out);
934  }
935  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideRC ) {
937  setup.exp->sin(v, setup.x);
938  setup.exp->divide(setup.u, v, setup.a);
939  computePCE2RC<DivideFunc>(setup.u2, v, setup.a, *setup.quad);
940  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
941  setup.rtol, setup.atol, out);
942  }
943  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideCC ) {
944  setup.exp->divide(setup.cu, setup.cx, setup.cx);
945  computePCE2<DivideFunc>(setup.cu2, setup.cx, setup.cx, *setup.quad);
946  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
947  setup.rtol, setup.atol, out);
948  }
949  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideLC2 ) {
951  setup.exp->sin(v, setup.x);
952  setup.exp->divide(setup.u, setup.cx, v);
953  computePCE2LC<DivideFunc>(setup.u2, setup.cx[0], v, *setup.quad);
954  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
955  setup.rtol, setup.atol, out);
956  }
957  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideRC2 ) {
959  setup.exp->sin(v, setup.x);
960  setup.exp->divide(setup.u, v, setup.cx);
961  computePCE2RC<DivideFunc>(setup.u2, v, setup.cx[0], *setup.quad);
962  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
963  setup.rtol, setup.atol, out);
964  }
965  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideResize ) {
968  setup.exp->sin(v, setup.x);
969  setup.exp->exp(w, setup.y);
970  setup.exp->divide(ru, v, w);
971  computePCE2<DivideFunc>(setup.u2, v, w, *setup.quad);
972  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
973  setup.rtol, setup.atol, out);
974  }
975  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideLCResize ) {
978  setup.exp->sin(v, setup.x);
979  setup.exp->divide(ru, setup.a, v);
980  computePCE2LC<DivideFunc>(setup.u2, setup.a, v, *setup.quad);
981  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
982  setup.rtol, setup.atol, out);
983  }
984  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideRCResize ) {
987  setup.exp->sin(v, setup.x);
988  setup.exp->divide(ru, v, setup.a);
989  computePCE2RC<DivideFunc>(setup.u2, v, setup.a, *setup.quad);
990  success = Stokhos::comparePCEs(ru, "u", setup.u2, "u2",
991  setup.rtol, setup.atol, out);
992  }
993  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideLS ) {
995  setup.exp->sin(v, setup.x);
996  setup.exp->divide(setup.u, setup.sx, v);
997  computePCE2<DivideFunc>(setup.u2, setup.sx, v, *setup.quad);
998  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
999  setup.rtol, setup.atol, out);
1000  }
1001  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideRS ) {
1003  setup.exp->sin(v, setup.x);
1004  setup.exp->divide(setup.u, v, setup.sx);
1005  computePCE2<DivideFunc>(setup.u2, v, setup.sx, *setup.quad);
1006  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1007  setup.rtol, setup.atol, out);
1008  }
1009  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideLSRC ) {
1010  setup.exp->divide(setup.su, setup.sx, setup.a);
1011  computePCE2RC<DivideFunc>(setup.su2, setup.sx, setup.a, *setup.quad);
1012  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
1013  setup.rtol, setup.atol, out);
1014  }
1015  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideRSLC ) {
1016  setup.exp->divide(setup.u, setup.a, setup.sx);
1017  computePCE2LC<DivideFunc>(setup.u2, setup.a, setup.sx, *setup.quad);
1018  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1019  setup.rtol, setup.atol, out);
1020  }
1021  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideLSRC2 ) {
1022  setup.exp->divide(setup.su, setup.sx, setup.cx);
1023  computePCE2<DivideFunc>(setup.su2, setup.sx, setup.cx, *setup.quad);
1024  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
1025  setup.rtol, setup.atol, out);
1026  }
1027  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideRSLC2 ) {
1028  setup.exp->divide(setup.u, setup.cx, setup.sx);
1029  computePCE2<DivideFunc>(setup.u2, setup.cx, setup.sx, *setup.quad);
1030  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1031  setup.rtol, setup.atol, out);
1032  }
1033 
1034  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, Pow ) {
1035  setup.exp->pow(setup.u, setup.x, setup.y);
1036  computePCE2<PowFunc>(setup.u2, setup.x, setup.y, *setup.quad);
1037  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1038  setup.rtol, setup.atol, out);
1039  }
1040  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PowLC ) {
1041  setup.exp->pow(setup.u, setup.a, setup.y);
1042  computePCE2LC<PowFunc>(setup.u2, setup.a, setup.y, *setup.quad);
1043  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1044  setup.rtol, setup.atol, out);
1045  }
1046  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PowRC ) {
1047  setup.exp->pow(setup.u, setup.x, setup.a);
1048  computePCE2RC<PowFunc>(setup.u2, setup.x, setup.a, *setup.quad);
1049  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1050  setup.rtol, setup.atol, out);
1051  }
1052  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PowCC ) {
1053  setup.exp->pow(setup.cu, setup.cx, setup.cx);
1054  computePCE2<PowFunc>(setup.cu2, setup.cx, setup.cx, *setup.quad);
1055  success = Stokhos::comparePCEs(setup.cu, "cu", setup.cu2, "cu2",
1056  setup.rtol, setup.atol, out);
1057  }
1058  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PowLC2 ) {
1059  setup.exp->pow(setup.u, setup.cx, setup.y);
1060  computePCE2LC<PowFunc>(setup.u2, setup.cx[0], setup.y, *setup.quad);
1061  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1062  setup.rtol, setup.atol, out);
1063  }
1064  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PowRC2 ) {
1065  setup.exp->pow(setup.u, setup.x, setup.cx);
1066  computePCE2RC<PowFunc>(setup.u2, setup.x, setup.cx[0], *setup.quad);
1067  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1068  setup.rtol, setup.atol, out);
1069  }
1070  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PowResize ) {
1072  setup.exp->pow(ru, setup.x, setup.y);
1073  computePCE2<PowFunc>(setup.u2, setup.x, setup.y, *setup.quad);
1074  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
1075  setup.rtol, setup.atol, out);
1076  }
1077  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PowLCResize ) {
1079  setup.exp->pow(ru, setup.a, setup.y);
1080  computePCE2LC<PowFunc>(setup.u2, setup.a, setup.y, *setup.quad);
1081  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
1082  setup.rtol, setup.atol, out);
1083  }
1084  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PowRCResize ) {
1086  setup.exp->pow(ru, setup.x, setup.a);
1087  computePCE2RC<PowFunc>(setup.u2, setup.x, setup.a, *setup.quad);
1088  success = Stokhos::comparePCEs(ru, "ru", setup.u2, "u2",
1089  setup.rtol, setup.atol, out);
1090  }
1091  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PowLS ) {
1092  setup.exp->pow(setup.u, setup.sx, setup.y);
1093  computePCE2<PowFunc>(setup.u2, setup.sx, setup.y, *setup.quad);
1094  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1095  setup.rtol, setup.atol, out);
1096  }
1097  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PowRS ) {
1098  setup.exp->pow(setup.u, setup.x, setup.sx);
1099  computePCE2<PowFunc>(setup.u2, setup.x, setup.sx, *setup.quad);
1100  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1101  setup.rtol, setup.atol, out);
1102  }
1103  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PowLSRC ) {
1104  setup.exp->pow(setup.u, setup.sx, setup.a);
1105  computePCE2RC<PowFunc>(setup.u2, setup.sx, setup.a, *setup.quad);
1106  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1107  setup.rtol, setup.atol, out);
1108  }
1109  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PowRSLC ) {
1110  setup.exp->pow(setup.u, setup.a, setup.sx);
1111  computePCE2LC<PowFunc>(setup.u2, setup.a, setup.sx, *setup.quad);
1112  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1113  setup.rtol, setup.atol, out);
1114  }
1115  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PowLSRC2 ) {
1116  setup.exp->pow(setup.u, setup.sx, setup.cx);
1117  computePCE2<PowFunc>(setup.u2, setup.sx, setup.cx, *setup.quad);
1118  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1119  setup.rtol, setup.atol, out);
1120  }
1121  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PowRSLC2 ) {
1122  setup.exp->pow(setup.u, setup.cx, setup.sx);
1123  computePCE2<PowFunc>(setup.u2, setup.cx, setup.sx, *setup.quad);
1124  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1125  setup.rtol, setup.atol, out);
1126  }
1127 
1128  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusEqual ) {
1130  setup.exp->sin(v, setup.x);
1131  setup.exp->cos(setup.u, setup.x);
1132  computePCE2<PlusFunc>(setup.u2, setup.u, v, *setup.quad);
1133  setup.exp->plusEqual(setup.u, v);
1134  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1135  setup.rtol, setup.atol, out);
1136  }
1137  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusEqualC ) {
1138  setup.exp->cos(setup.u, setup.x);
1139  computePCE2RC<PlusFunc>(setup.u2, setup.u, setup.a, *setup.quad);
1140  setup.exp->plusEqual(setup.u, setup.a);
1141  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1142  setup.rtol, setup.atol, out);
1143  }
1144  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusEqualC2 ) {
1145  setup.exp->cos(setup.u, setup.x);
1146  computePCE2RC<PlusFunc>(setup.u2, setup.u, setup.cx[0], *setup.quad);
1147  setup.exp->plusEqual(setup.u, setup.cx);
1148  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1149  setup.rtol, setup.atol, out);
1150  }
1151  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusEqualResize ) {
1154  setup.exp->sin(v, setup.x);
1155  setup.exp->plusEqual(ru, v);
1156  success = Stokhos::comparePCEs(ru, "ru", v, "v",
1157  setup.rtol, setup.atol, out);
1158  }
1159  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusEqualS ) {
1160  setup.exp->cos(setup.u, setup.x);
1161  computePCE2<PlusFunc>(setup.u2, setup.u, setup.sx, *setup.quad);
1162  setup.exp->plusEqual(setup.u, setup.sx);
1163  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1164  setup.rtol, setup.atol, out);
1165  }
1166  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusEqualSC ) {
1167  setup.su = setup.sx;
1168  computePCE2RC<PlusFunc>(setup.su2, setup.su, setup.a, *setup.quad);
1169  setup.exp->plusEqual(setup.su, setup.a);
1170  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
1171  setup.rtol, setup.atol, out);
1172  }
1173  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, PlusEqualSC2 ) {
1174  setup.su = setup.sx;
1175  computePCE2<PlusFunc>(setup.su2, setup.su, setup.cx, *setup.quad);
1176  setup.exp->plusEqual(setup.su, setup.cx);
1177  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
1178  setup.rtol, setup.atol, out);
1179  }
1180 
1181  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusEqual ) {
1183  setup.exp->sin(v, setup.x);
1184  setup.exp->cos(setup.u, setup.x);
1185  computePCE2<MinusFunc>(setup.u2, setup.u, v, *setup.quad);
1186  setup.exp->minusEqual(setup.u, v);
1187  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1188  setup.rtol, setup.atol, out);
1189  }
1190  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusEqualC ) {
1191  setup.exp->cos(setup.u, setup.x);
1192  computePCE2RC<MinusFunc>(setup.u2, setup.u, setup.a, *setup.quad);
1193  setup.exp->minusEqual(setup.u, setup.a);
1194  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1195  setup.rtol, setup.atol, out);
1196  }
1197  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusEqualC2 ) {
1198  setup.exp->cos(setup.u, setup.x);
1199  computePCE2RC<MinusFunc>(setup.u2, setup.u, setup.cx[0], *setup.quad);
1200  setup.exp->minusEqual(setup.u, setup.cx);
1201  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1202  setup.rtol, setup.atol, out);
1203  }
1204  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusEqualResize ) {
1207  setup.exp->sin(v, setup.x);
1208  setup.exp->minusEqual(ru, v);
1209  setup.exp->unaryMinus(v, v);
1210  success = Stokhos::comparePCEs(ru, "ru", v, "v",
1211  setup.rtol, setup.atol, out);
1212  }
1213  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusEqualS ) {
1214  setup.exp->cos(setup.u, setup.x);
1215  computePCE2<MinusFunc>(setup.u2, setup.u, setup.sx, *setup.quad);
1216  setup.exp->minusEqual(setup.u, setup.sx);
1217  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1218  setup.rtol, setup.atol, out);
1219  }
1220  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusEqualSC ) {
1221  setup.su = setup.sx;
1222  computePCE2RC<MinusFunc>(setup.su2, setup.su, setup.a, *setup.quad);
1223  setup.exp->minusEqual(setup.su, setup.a);
1224  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
1225  setup.rtol, setup.atol, out);
1226  }
1227  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, MinusEqualSC2 ) {
1228  setup.su = setup.sx;
1229  computePCE2<MinusFunc>(setup.su2, setup.su, setup.cx, *setup.quad);
1230  setup.exp->minusEqual(setup.su, setup.cx);
1231  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
1232  setup.rtol, setup.atol, out);
1233  }
1234 
1235  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesEqual ) {
1237  setup.exp->sin(v, setup.x);
1238  setup.exp->cos(setup.u, setup.x);
1239  computePCE2<TimesFunc>(setup.u2, setup.u, v, *setup.quad);
1240  setup.exp->timesEqual(setup.u, v);
1241  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1242  setup.rtol, setup.atol, out);
1243  }
1244  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesEqualC ) {
1245  setup.exp->cos(setup.u, setup.x);
1246  computePCE2RC<TimesFunc>(setup.u2, setup.u, setup.a, *setup.quad);
1247  setup.exp->timesEqual(setup.u, setup.a);
1248  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1249  setup.rtol, setup.atol, out);
1250  }
1251  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesEqualC2 ) {
1252  setup.exp->cos(setup.u, setup.x);
1253  computePCE2RC<TimesFunc>(setup.u2, setup.u, setup.cx[0], *setup.quad);
1254  setup.exp->timesEqual(setup.u, setup.cx);
1255  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1256  setup.rtol, setup.atol, out);
1257  }
1258  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesEqualResize ) {
1260  setup.exp->sin(v, setup.x);
1261  setup.su = setup.sx;
1262  computePCE2<TimesFunc>(setup.u2, setup.su, v, *setup.quad);
1263  setup.exp->timesEqual(setup.su, v);
1264  success = Stokhos::comparePCEs(setup.su, "su", setup.u2, "u2",
1265  setup.rtol, setup.atol, out);
1266  }
1267  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesEqualS ) {
1268  setup.exp->cos(setup.u, setup.x);
1269  computePCE2<TimesFunc>(setup.u2, setup.u, setup.sx, *setup.quad);
1270  setup.exp->timesEqual(setup.u, setup.sx);
1271  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1272  setup.rtol, setup.atol, out);
1273  }
1274  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesEqualSLinear ) {
1275  setup.exp->cos(setup.u, setup.x);
1276  computePCE2<TimesFunc>(setup.u2, setup.u, setup.sx, *setup.quad);
1277  setup.exp_linear->timesEqual(setup.u, setup.sx);
1278  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1279  setup.rtol, setup.atol, out);
1280  }
1281  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesEqualSC ) {
1282  setup.su = setup.sx;
1283  computePCE2RC<TimesFunc>(setup.su2, setup.su, setup.a, *setup.quad);
1284  setup.exp->timesEqual(setup.su, setup.a);
1285  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
1286  setup.rtol, setup.atol, out);
1287  }
1288  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, TimesEqualSC2 ) {
1289  setup.su = setup.sx;
1290  computePCE2<TimesFunc>(setup.su2, setup.su, setup.cx, *setup.quad);
1291  setup.exp->timesEqual(setup.su, setup.cx);
1292  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
1293  setup.rtol, setup.atol, out);
1294  }
1295 
1296  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideEqual ) {
1298  setup.exp->sin(v, setup.x);
1299  setup.exp->cos(setup.u, setup.x);
1300  computePCE2<DivideFunc>(setup.u2, setup.u, v, *setup.quad);
1301  setup.exp->divideEqual(setup.u, v);
1302  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1303  setup.rtol, setup.atol, out);
1304  }
1305  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideEqualC ) {
1306  setup.exp->cos(setup.u, setup.x);
1307  computePCE2RC<DivideFunc>(setup.u2, setup.u, setup.a, *setup.quad);
1308  setup.exp->divideEqual(setup.u, setup.a);
1309  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1310  setup.rtol, setup.atol, out);
1311  }
1312  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideEqualC2 ) {
1313  setup.exp->cos(setup.u, setup.x);
1314  computePCE2RC<DivideFunc>(setup.u2, setup.u, setup.cx[0], *setup.quad);
1315  setup.exp->divideEqual(setup.u, setup.cx);
1316  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1317  setup.rtol, setup.atol, out);
1318  }
1319  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideEqualResize ) {
1321  setup.exp->sin(v, setup.x);
1322  setup.su = setup.sx;
1323  computePCE2<DivideFunc>(setup.u2, setup.su, v, *setup.quad);
1324  setup.exp->divideEqual(setup.su, v);
1325  success = Stokhos::comparePCEs(setup.su, "su", setup.u2, "u2",
1326  setup.rtol, setup.atol, out);
1327  }
1328  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideEqualS ) {
1329  setup.exp->cos(setup.u, setup.x);
1330  computePCE2<DivideFunc>(setup.u2, setup.u, setup.sx, *setup.quad);
1331  setup.exp->divideEqual(setup.u, setup.sx);
1332  success = Stokhos::comparePCEs(setup.u, "u", setup.u2, "u2",
1333  setup.rtol, setup.atol, out);
1334  }
1335  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideEqualSC ) {
1336  setup.su = setup.sx;
1337  computePCE2RC<DivideFunc>(setup.su2, setup.su, setup.a, *setup.quad);
1338  setup.exp->divideEqual(setup.su, setup.a);
1339  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
1340  setup.rtol, setup.atol, out);
1341  }
1342  TEUCHOS_UNIT_TEST( Stokhos_PSExpansion, DivideEqualSC2 ) {
1343  setup.su = setup.sx;
1344  computePCE2<DivideFunc>(setup.su2, setup.su, setup.cx, *setup.quad);
1345  setup.exp->divideEqual(setup.su, setup.cx);
1346  success = Stokhos::comparePCEs(setup.su, "su", setup.su2, "su2",
1347  setup.rtol, setup.atol, out);
1348  }
1349 
1350  // Not testing atan2(), max(), min(), abs(), fabs() since these are
1351  // not smooth functions
1352 
1353 }
KOKKOS_INLINE_FUNCTION PCE< Storage > sqrt(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > tan(const PCE< Storage > &a)
void computePCE2LC(Stokhos::OrthogPolyApprox< OrdinalType, ValueType > &c, ValueType a, const Stokhos::OrthogPolyApprox< OrdinalType, ValueType > &b, const Stokhos::Quadrature< OrdinalType, ValueType > &quad)
KOKKOS_INLINE_FUNCTION PCE< Storage > sinh(const PCE< Storage > &a)
value_type evaluate(const Teuchos::Array< value_type > &point) const
Evaluate polynomial approximation at a point.
KOKKOS_INLINE_FUNCTION PCE< Storage > pow(const PCE< Storage > &a, const PCE< Storage > &b)
bool comparePCEs(const PCEType &a1, const std::string &a1_name, const Stokhos::OrthogPolyApprox< OrdinalType, ValueType > &a2, const std::string &a2_name, const ValueType &rel_tol, const ValueType &abs_tol, Teuchos::FancyOStream &out)
virtual const Teuchos::Array< Teuchos::Array< value_type > > & getBasisAtQuadPoints() const =0
Get values of basis at quadrature points.
void computePCE1(Stokhos::OrthogPolyApprox< OrdinalType, ValueType > &c, const Stokhos::OrthogPolyApprox< OrdinalType, ValueType > &a, const Stokhos::Quadrature< OrdinalType, ValueType > &quad)
KOKKOS_INLINE_FUNCTION PCE< Storage > tanh(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > cbrt(const PCE< Storage > &a)
void computePCE2RC(Stokhos::OrthogPolyApprox< OrdinalType, ValueType > &c, const Stokhos::OrthogPolyApprox< OrdinalType, ValueType > &a, ValueType b, const Stokhos::Quadrature< OrdinalType, ValueType > &quad)
KOKKOS_INLINE_FUNCTION PCE< Storage > acos(const PCE< Storage > &a)
virtual const Teuchos::Array< value_type > & getQuadWeights() const =0
Get quadrature weights.
virtual const Teuchos::Array< Teuchos::Array< value_type > > & getQuadPoints() const =0
Get quadrature points.
KOKKOS_INLINE_FUNCTION PCE< Storage > cosh(const PCE< Storage > &a)
Teuchos::RCP< const Stokhos::OrthogPolyBasis< ordinal_type, value_type > > basis() const
Return basis.
KOKKOS_INLINE_FUNCTION PCE< Storage > atan(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > exp(const PCE< Storage > &a)
expr val()
ScalarType f(const Teuchos::Array< ScalarType > &x, double a, double b)
size_type size() const
KOKKOS_INLINE_FUNCTION PCE< Storage > sin(const PCE< Storage > &a)
ordinal_type size() const
Return size.
void computePCE2(Stokhos::OrthogPolyApprox< OrdinalType, ValueType > &c, const Stokhos::OrthogPolyApprox< OrdinalType, ValueType > &a, const Stokhos::OrthogPolyApprox< OrdinalType, ValueType > &b, const Stokhos::Quadrature< OrdinalType, ValueType > &quad)
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)
KOKKOS_INLINE_FUNCTION PCE< Storage > cos(const PCE< Storage > &a)