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