Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TayUnitTests.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Sacado Package
5 // Copyright (2006) Sandia Corporation
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8 // the U.S. Government retains certain rights in this software.
9 //
10 // This library is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as
12 // published by the Free Software Foundation; either version 2.1 of the
13 // License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 // USA
24 // Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps
25 // (etphipp@sandia.gov).
26 //
27 // ***********************************************************************
28 // @HEADER
29 
30 #ifndef TAYLORUNITTESTS_HPP
31 #define TAYLORUNITTESTS_HPP
32 
33 // ADOL-C includes
34 #include "adolc/adouble.h"
35 #include "adolc/interfaces.h"
36 #include "adolc/taping.h"
37 
38 // Sacado includes
39 #include "Sacado_No_Kokkos.hpp"
40 #include "Sacado_Random.hpp"
41 
42 inline adouble max(const adouble& a, const adouble& b) { return fmax(a,b); }
43 inline adouble max(const adouble& a, double v) { return fmax(a,v); }
44 inline adouble max(double v, const adouble& b) { return fmax(v,b); }
45 inline adouble min(const adouble& a, const adouble& b) { return fmin(a,b); }
46 inline adouble min(const adouble& a, double v) { return fmin(a,v); }
47 inline adouble min(double v, const adouble& b) { return fmin(v,b); }
48 
49 // gtest includes
50 #include <gtest/gtest.h>
51 
52 #include "GTestUtils.hpp"
53 
54 #define COMPARE_POLYS(x_dtay, x_adolc) \
55  ASSERT_TRUE(x_dtay.degree() == d); \
56  for (int i=0; i<=d; i++) { \
57  COMPARE_VALUES(x_dtay.coeff(i), x_adolc[i]); \
58  } \
59  ;
60 
61 #define COMPARE_TAYS(x_dtay, y_dtay) \
62  ASSERT_TRUE(x_dtay.degree() == y_dtay.degree()); \
63  for (int i=0; i<=x_dtay.degree(); i++) { \
64  COMPARE_VALUES(x_dtay.coeff(i), y_dtay.coeff(i)); \
65  } \
66  ;
67 
68 // A class for testing each Taylor operation
69 template <class TaylorType>
71 protected:
72 
73  // Taylor variables
75 
76  // ADOL-C arrays
77  double **X_, **Y_;
78 
79  // Random number generator
81 
82  // Degree of polynomials
83  int d_;
84 
85  // Tolerances to which fad objects should be the same
86  double tol_a, tol_r;
87 
89  urand(), d_(5), tol_a(1.0e-11), tol_r(1.0e-10)
90  {
91  X_ = new double*[2];
92  X_[0] = new double[d_+1];
93  X_[1] = new double[d_+1];
94 
95  Y_ = new double*[1];
96  Y_[0] = new double[d_+1];
97  }
98 
100  {
101  delete [] X_[1];
102  delete [] X_[0];
103  delete [] X_;
104 
105  delete [] Y_[0];
106  delete [] Y_;
107  }
108 
109  void SetUp() {
110  double val;
111 
112  a_dtay_ = TaylorType(d_,0.0);
113  b_dtay_ = TaylorType(d_,0.0);
114 
115  for (int i=0; i<=d_; i++) {
116  val = urand.number();
118  X_[0][i] = val;
119 
120  val = urand.number();
122  X_[1][i] = val;
123 
124  Y_[0][i] = 0.0;
125  }
126  }
127 
128  void TearDown() {}
129 
130  template <typename ScalarT>
131  ScalarT composite1(const ScalarT& a, const ScalarT& b) {
132  ScalarT t1 = 3. * a + sin(b) / log(fabs(a - b * 7.));
133  ScalarT t2 = 1.0e3;
134  ScalarT t3 = 5.7e4;
135  ScalarT t4 = 3.2e5;
136  t1 *= cos(a + exp(t1)) / 6. - tan(t1*sqrt(fabs(a * log10(fabs(b)))));
137  t1 -= acos((6.+asin(pow(fabs(a),b)/t2))/t3) * asin(pow(fabs(b),2.)*1.0/t4) * atan((b*pow(2.,log(fabs(a))))/(t3*t4));
138  t1 /= cosh(b - 0.7) + 7.*sinh(t1 + 0.8)*tanh(9./(a+1.)) - 9.;
139  t1 += pow(fabs(a*4.),b-8.)/cos(a*b*a);
140 
141  return t1;
142  }
143 
144  // void print_poly(double *x) {
145  // std::cout.setf(std::ios::fixed,std::ios::floatfield);
146  // std::cout.width(12);
147  // std::cout << "[";
148 
149  // for (int i=0; i<=d_; i++) {
150  // std::cout.width(12);
151  // std::cout << x[i];
152  // }
153 
154  // std::cout << "]\n";
155  // }
156 
157  // void print_diff(const TaylorType& x_dtay, double* x_adolc) {
158  // std::cout.setf(std::ios::fixed,std::ios::floatfield);
159  // std::cout.width(12);
160  // std::cout << "[";
161 
162  // for (int i=0; i<=d_; i++) {
163  // std::cout.width(12);
164  // std::cout << x[i];
165  // }
166 
167  // std::cout << "]\n";
168  // }
169 
170 }; // class TaylorOpsUnitTest
171 
172 // Additional test fixture of max/min since CacheTaylor doesn't implement them
173 template <typename TaylorType>
174 class TaylorMaxMinUnitTest : public TaylorOpsUnitTest< TaylorType > {
175 protected:
178 };
179 
182 
183 #define BINARY_OP2_TEST(FIXTURENAME,TESTNAME,OP) \
184  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
185  auto a_dtay = this->a_dtay_; \
186  auto b_dtay = this->b_dtay_; \
187  auto c_dtay = this->c_dtay_; \
188  auto d = this->d_; \
189  auto X = this->X_; \
190  auto Y = this->Y_; \
191  c_dtay = a_dtay OP b_dtay; \
192  trace_on(0); \
193  adouble aa, ab, ac; \
194  aa <<= X[0][0]; \
195  ab <<= X[1][0]; \
196  ac = aa OP ab; \
197  ac >>= Y[0][0]; \
198  trace_off(); \
199  forward(0,1,2,d,0,X,Y); \
200  COMPARE_POLYS(c_dtay,Y[0]); \
201  }
202 
203 #define BINARY_OPRC_TEST(FIXTURENAME,TESTNAME,OP) \
204  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
205  auto a_dtay = this->a_dtay_; \
206  auto c_dtay = this->c_dtay_; \
207  auto d = this->d_; \
208  auto X = this->X_; \
209  auto Y = this->Y_; \
210  double val = this->urand.number(); \
211  c_dtay = a_dtay OP val; \
212  trace_on(0); \
213  adouble aa, ac; \
214  aa <<= X[0][0]; \
215  ac = aa OP val; \
216  ac >>= Y[0][0]; \
217  trace_off(); \
218  forward(0,1,1,d,0,X,Y); \
219  COMPARE_POLYS(c_dtay,Y[0]); \
220  }
221 
222 #define BINARY_OPLC_TEST(FIXTURENAME,TESTNAME,OP) \
223  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
224  auto a_dtay = this->a_dtay_; \
225  auto c_dtay = this->c_dtay_; \
226  auto d = this->d_; \
227  auto X = this->X_; \
228  auto Y = this->Y_; \
229  double val = this->urand.number(); \
230  c_dtay = val OP a_dtay; \
231  trace_on(0); \
232  adouble aa, ac; \
233  aa <<= X[0][0]; \
234  ac = val OP aa; \
235  ac >>= Y[0][0]; \
236  trace_off(); \
237  forward(0,1,1,d,0,X,Y); \
238  COMPARE_POLYS(c_dtay,Y[0]); \
239  }
240 
241 #define BINARY_OP_TEST(FIXTURENAME,TESTNAME,OP) \
242  BINARY_OP2_TEST(FIXTURENAME,TESTNAME,OP) \
243  BINARY_OPLC_TEST(FIXTURENAME,TESTNAME ## LeftConstant,OP) \
244  BINARY_OPRC_TEST(FIXTURENAME,TESTNAME ## RightConstant,OP)
245 
246 #define RELOP_OP2_TEST(FIXTURENAME,TESTNAME,OP) \
247  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
248  auto a_dtay = this->a_dtay_; \
249  auto b_dtay = this->b_dtay_; \
250  bool r1 = a_dtay OP b_dtay; \
251  bool r2 = a_dtay.coeff(0) OP b_dtay.coeff(0); \
252  ASSERT_TRUE(r1 == r2); \
253  }
254 
255 #define RELOP_OPLC_TEST(FIXTURENAME,TESTNAME,OP) \
256  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
257  auto b_dtay = this->b_dtay_; \
258  double val = this->urand.number(); \
259  bool r1 = val OP b_dtay; \
260  bool r2 = val OP b_dtay.coeff(0); \
261  ASSERT_TRUE(r1 == r2); \
262  }
263 
264 #define RELOP_OPRC_TEST(FIXTURENAME,TESTNAME,OP) \
265  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
266  auto a_dtay = this->b_dtay_; \
267  double val = this->urand.number(); \
268  bool r1 = a_dtay OP val; \
269  bool r2 = a_dtay.coeff(0) OP val; \
270  ASSERT_TRUE(r1 == r2); \
271  }
272 
273 #define RELOP_OP_TEST(FIXTURENAME,TESTNAME,OP) \
274  RELOP_OP2_TEST(FIXTURENAME,TESTNAME,OP) \
275  RELOP_OPLC_TEST(FIXTURENAME,TESTNAME ## LeftConstant,OP) \
276  RELOP_OPRC_TEST(FIXTURENAME,TESTNAME ## RightConstant,OP)
277 
278 #define BINARY_FUNC2_TEST(FIXTURENAME,TESTNAME,FUNC) \
279  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
280  auto a_dtay = this->a_dtay_; \
281  auto b_dtay = this->b_dtay_; \
282  auto c_dtay = this->c_dtay_; \
283  auto d = this->d_; \
284  auto X = this->X_; \
285  auto Y = this->Y_; \
286  c_dtay = FUNC (a_dtay, b_dtay); \
287  trace_on(0); \
288  adouble aa, ab, ac; \
289  aa <<= X[0][0]; \
290  ab <<= X[1][0]; \
291  ac = FUNC (aa, ab); \
292  ac >>= Y[0][0]; \
293  trace_off(); \
294  forward(0,1,2,d,0,X,Y); \
295  COMPARE_POLYS(c_dtay,Y[0]); \
296  }
297 
298 #define BINARY_FUNCRC_TEST(FIXTURENAME,TESTNAME,FUNC) \
299  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
300  auto a_dtay = this->a_dtay_; \
301  auto c_dtay = this->c_dtay_; \
302  auto d = this->d_; \
303  auto X = this->X_; \
304  auto Y = this->Y_; \
305  double val = this->urand.number(); \
306  c_dtay = FUNC (a_dtay, val); \
307  trace_on(0); \
308  adouble aa, ac; \
309  aa <<= X[0][0]; \
310  ac = FUNC (aa, val); \
311  ac >>= Y[0][0]; \
312  trace_off(); \
313  forward(0,1,1,d,0,X,Y); \
314  COMPARE_POLYS(c_dtay,Y[0]); \
315  }
316 
317 #define BINARY_FUNCLC_TEST(FIXTURENAME,TESTNAME,FUNC) \
318  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
319  auto a_dtay = this->a_dtay_; \
320  auto c_dtay = this->c_dtay_; \
321  auto d = this->d_; \
322  auto X = this->X_; \
323  auto Y = this->Y_; \
324  double val = this->urand.number(); \
325  c_dtay = FUNC (val, a_dtay); \
326  trace_on(0); \
327  adouble aa, ac; \
328  aa <<= X[0][0]; \
329  ac = FUNC (val, aa); \
330  ac >>= Y[0][0]; \
331  trace_off(); \
332  forward(0,1,1,d,0,X,Y); \
333  COMPARE_POLYS(c_dtay,Y[0]); \
334  }
335 
336 #define BINARY_FUNC_TEST(FIXTURENAME,TESTNAME,FUNC) \
337  BINARY_FUNC2_TEST(FIXTURENAME,TESTNAME,FUNC) \
338  BINARY_FUNCLC_TEST(FIXTURENAME,TESTNAME ## LeftConstant,FUNC) \
339  BINARY_FUNCRC_TEST(FIXTURENAME,TESTNAME ## RightConstant,FUNC)
340 
341 #define UNARY_OP_TEST(FIXTURENAME,TESTNAME,OP) \
342  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
343  auto a_dtay = this->a_dtay_; \
344  auto c_dtay = this->c_dtay_; \
345  auto d = this->d_; \
346  auto X = this->X_; \
347  auto Y = this->Y_; \
348  c_dtay = OP a_dtay; \
349  trace_on(0); \
350  adouble aa, ac; \
351  aa <<= X[0][0]; \
352  ac = OP aa; \
353  ac >>= Y[0][0]; \
354  trace_off(); \
355  forward(0,1,1,d,0,X,Y); \
356  COMPARE_POLYS(c_dtay,Y[0]); \
357  }
358 
359 #define UNARY_FUNC_TEST(FIXTURENAME,TESTNAME,FUNC) \
360  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
361  auto a_dtay = this->a_dtay_; \
362  auto c_dtay = this->c_dtay_; \
363  auto d = this->d_; \
364  auto X = this->X_; \
365  auto Y = this->Y_; \
366  c_dtay = FUNC (a_dtay); \
367  trace_on(0); \
368  adouble aa, ac; \
369  aa <<= X[0][0]; \
370  ac = FUNC (aa); \
371  ac >>= Y[0][0]; \
372  trace_off(); \
373  forward(0,1,1,d,0,X,Y); \
374  COMPARE_POLYS(c_dtay,Y[0]); \
375  }
376 
377 #define UNARY_ASSIGNOP2_TEST(FIXTURENAME,TESTNAME,OP) \
378  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
379  auto a_dtay = this->a_dtay_; \
380  auto b_dtay = this->b_dtay_; \
381  auto c_dtay = this->c_dtay_; \
382  auto d = this->d_; \
383  auto X = this->X_; \
384  auto Y = this->Y_; \
385  c_dtay = a_dtay; \
386  c_dtay OP b_dtay; \
387  trace_on(0); \
388  adouble aa, ab, ac; \
389  aa <<= X[0][0]; \
390  ab <<= X[1][0]; \
391  ac = aa; \
392  ac OP ab; \
393  ac >>= Y[0][0]; \
394  trace_off(); \
395  forward(0,1,2,d,0,X,Y); \
396  COMPARE_POLYS(c_dtay,Y[0]); \
397  }
398 
399 #define UNARY_ASSIGNOPRC_TEST(FIXTURENAME,TESTNAME,OP) \
400  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
401  auto a_dtay = this->a_dtay_; \
402  auto c_dtay = this->c_dtay_; \
403  auto d = this->d_; \
404  auto X = this->X_; \
405  auto Y = this->Y_; \
406  double val = this->urand.number(); \
407  c_dtay = a_dtay; \
408  c_dtay OP val; \
409  trace_on(0); \
410  adouble aa, ac; \
411  aa <<= X[0][0]; \
412  ac = aa; \
413  ac OP val; \
414  ac >>= Y[0][0]; \
415  trace_off(); \
416  forward(0,1,1,d,0,X,Y); \
417  COMPARE_POLYS(c_dtay,Y[0]); \
418  }
419 
420 #define UNARY_ASSIGNOPLC_TEST(FIXTURENAME,TESTNAME,OP) \
421  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
422  auto a_dtay = this->a_dtay_; \
423  auto c_dtay = this->c_dtay_; \
424  auto d = this->d_; \
425  auto X = this->X_; \
426  auto Y = this->Y_; \
427  double val = this->urand.number(); \
428  c_dtay = val; \
429  c_dtay OP a_dtay; \
430  trace_on(0); \
431  adouble aa, ac; \
432  aa <<= X[0][0]; \
433  ac = val; \
434  ac OP aa; \
435  ac >>= Y[0][0]; \
436  trace_off(); \
437  forward(0,1,1,d,0,X,Y); \
438  COMPARE_POLYS(c_dtay,Y[0]); \
439  }
440 
441 #define UNARY_ASSIGNOP_TEST(FIXTURENAME,TESTNAME,OP) \
442  UNARY_ASSIGNOP2_TEST(FIXTURENAME,TESTNAME,OP) \
443  UNARY_ASSIGNOPLC_TEST(FIXTURENAME,TESTNAME ## LeftConstant,OP) \
444  UNARY_ASSIGNOPRC_TEST(FIXTURENAME,TESTNAME ## RightConstant,OP)
445 
446 BINARY_OP_TEST(TaylorOpsUnitTest, testAddition, +)
447 BINARY_OP_TEST(TaylorOpsUnitTest, testSubtraction, -)
448 BINARY_OP_TEST(TaylorOpsUnitTest, testMultiplication, *)
449 BINARY_OP_TEST(TaylorOpsUnitTest, testDivision, /)
450 
451 RELOP_OP_TEST(TaylorOpsUnitTest, testEquals, ==)
452 RELOP_OP_TEST(TaylorOpsUnitTest, testNotEquals, !=)
453 RELOP_OP_TEST(TaylorOpsUnitTest, testLessThanOrEquals, <=)
454 RELOP_OP_TEST(TaylorOpsUnitTest, testGreaterThanOrEquals, >=)
455 RELOP_OP_TEST(TaylorOpsUnitTest, testLessThan, <)
456 RELOP_OP_TEST(TaylorOpsUnitTest, testGreaterThan, >)
457 
458 BINARY_FUNC_TEST(TaylorOpsUnitTest, testPow, pow)
459 
460 UNARY_OP_TEST(TaylorOpsUnitTest, testUnaryPlus, +)
461 UNARY_OP_TEST(TaylorOpsUnitTest, testUnaryMinus, -)
462 
463 UNARY_FUNC_TEST(TaylorOpsUnitTest, testExp, exp)
464 UNARY_FUNC_TEST(TaylorOpsUnitTest, testLog, log)
465 UNARY_FUNC_TEST(TaylorOpsUnitTest, testLog10, log10)
466 UNARY_FUNC_TEST(TaylorOpsUnitTest, testSqrt, sqrt)
467 UNARY_FUNC_TEST(TaylorOpsUnitTest, testCos, cos)
468 UNARY_FUNC_TEST(TaylorOpsUnitTest, testSin, sin)
469 UNARY_FUNC_TEST(TaylorOpsUnitTest, testTan, tan)
470 UNARY_FUNC_TEST(TaylorOpsUnitTest, testACos, acos)
471 UNARY_FUNC_TEST(TaylorOpsUnitTest, testASin, asin)
472 UNARY_FUNC_TEST(TaylorOpsUnitTest, testATan, atan)
473 UNARY_FUNC_TEST(TaylorOpsUnitTest, testCosh, cosh)
474 UNARY_FUNC_TEST(TaylorOpsUnitTest, testSinh, sinh)
475 UNARY_FUNC_TEST(TaylorOpsUnitTest, testTanh, tanh)
476 UNARY_FUNC_TEST(TaylorOpsUnitTest, testFAbs, fabs)
477 
478 UNARY_ASSIGNOP_TEST(TaylorOpsUnitTest, testPlusEquals, +=)
479 UNARY_ASSIGNOP_TEST(TaylorOpsUnitTest, testMinusEquals, -=)
480 UNARY_ASSIGNOP_TEST(TaylorOpsUnitTest, testTimesEquals, *=)
481 UNARY_ASSIGNOP_TEST(TaylorOpsUnitTest, testDivideEquals, /=)
482 
483 TYPED_TEST_P(TaylorOpsUnitTest, testComposite1) {
484  auto a_dtay = this->a_dtay_;
485  auto b_dtay = this->b_dtay_;
486  auto c_dtay = this->c_dtay_;
487  auto d = this->d_;
488  auto X = this->X_;
489  auto Y = this->Y_;
490  c_dtay = this->composite1(a_dtay, b_dtay);
491  trace_on(0);
492  adouble aa, ab, ac;
493  aa <<= X[0][0];
494  ab <<= X[1][0];
495  ac = this->composite1(aa,ab);
496  ac >>= Y[0][0];
497  trace_off();
498  forward(0,1,2,d,0,X,Y);
499  COMPARE_POLYS(c_dtay,Y[0]);
500 }
501 
503  typedef decltype(this->a_dtay_) TaylorType;
504  auto a_dtay = this->a_dtay_;
505  auto d = this->d_;
506  TaylorType a_diff1 = diff(a_dtay);
507  TaylorType a_diff2(d-1, 0.0);
508  for (int i=1; i<=d; ++i)
509  a_diff2.fastAccessCoeff(i-1) = a_dtay.fastAccessCoeff(i)*i;
510  COMPARE_TAYS(a_diff1, a_diff2);
511 }
512 
514  typedef decltype(this->a_dtay_) TaylorType;
515  auto a_dtay = this->a_dtay_;
516  TaylorType a_diff1 = diff(a_dtay, 3);
517  TaylorType a_diff2 = diff( diff( diff(a_dtay) ) );
518  COMPARE_TAYS(a_diff1, a_diff2);
519 }
520 
523  testAddition,
524  testAdditionLeftConstant,
525  testAdditionRightConstant,
526  testSubtraction,
527  testSubtractionLeftConstant,
528  testSubtractionRightConstant,
529  testMultiplication,
530  testMultiplicationLeftConstant,
531  testMultiplicationRightConstant,
532  testDivision,
533  testDivisionLeftConstant,
534  testDivisionRightConstant,
535  testEquals,
536  testEqualsLeftConstant,
537  testEqualsRightConstant,
538  testNotEquals,
539  testNotEqualsLeftConstant,
540  testNotEqualsRightConstant,
541  testLessThanOrEquals,
542  testLessThanOrEqualsLeftConstant,
543  testLessThanOrEqualsRightConstant,
544  testGreaterThanOrEquals,
545  testGreaterThanOrEqualsLeftConstant,
546  testGreaterThanOrEqualsRightConstant,
547  testLessThan,
548  testLessThanLeftConstant,
549  testLessThanRightConstant,
550  testGreaterThan,
551  testGreaterThanLeftConstant,
552  testGreaterThanRightConstant,
553  testUnaryPlus,
554  testUnaryMinus,
555  testExp,
556  testLog,
557  testLog10,
558  testSqrt,
559  testCos,
560  testSin,
561  testTan,
562  testACos,
563  testASin,
564  testATan,
565  testCosh,
566  testSinh,
567  testTanh,
568  testFAbs,
569  testPlusEquals,
570  testPlusEqualsLeftConstant,
571  testPlusEqualsRightConstant,
572  testMinusEquals,
573  testMinusEqualsLeftConstant,
574  testMinusEqualsRightConstant,
575  testTimesEquals,
576  testTimesEqualsLeftConstant,
577  testTimesEqualsRightConstant,
578  testDivideEquals,
579  testDivideEqualsLeftConstant,
580  testDivideEqualsRightConstant,
581  testPow,
582  testPowLeftConstant,
583  testPowRightConstant,
584  testComposite1,
585  testDiff1,
586  testDiff3);
587 
590 
592  TaylorMaxMinUnitTest,
593  testMax,
594  testMaxLeftConstant,
595  testMaxRightConstant,
596  testMin,
597  testMinLeftConstant,
598  testMinRightConstant);
599 
600 #endif // TAYLORUNITTESTS_HPP
REGISTER_TYPED_TEST_SUITE_P(FadBLASUnitTests, testSCAL1, testSCAL2, testSCAL3, testSCAL4, testCOPY1, testCOPY2, testCOPY3, testCOPY4, testAXPY1, testAXPY2, testAXPY3, testAXPY4, testDOT1, testDOT2, testDOT3, testDOT4, testNRM21, testNRM22, testGEMV1, testGEMV2, testGEMV3, testGEMV4, testGEMV5, testGEMV6, testGEMV7, testGEMV8, testGEMV9, testTRMV1, testTRMV2, testTRMV3, testTRMV4, testGER1, testGER2, testGER3, testGER4, testGER5, testGER6, testGER7, testGEMM1, testGEMM2, testGEMM3, testGEMM4, testGEMM5, testGEMM6, testGEMM7, testGEMM8, testGEMM9, testGEMM10, testSYMM1, testSYMM2, testSYMM3, testSYMM4, testSYMM5, testSYMM6, testSYMM7, testSYMM8, testSYMM9, testTRMM1, testTRMM2, testTRMM3, testTRMM4, testTRMM5, testTRMM6, testTRMM7, testTRSM1, testTRSM2, testTRSM3, testTRSM4, testTRSM5, testTRSM6, testTRSM7)
asin(expr.val())
cosh(expr.val())
TYPED_TEST_P(FadBLASUnitTests, testSCAL1)
#define RELOP_OP_TEST(FIXTURENAME, TESTNAME, OP)
atan(expr.val())
Sacado::Random< double > urand
#define COMPARE_TAYS(x_dtay, y_dtay)
ScalarT number()
Get random number.
Sacado::Tay::Taylor< double > TaylorType
expr val()
#define UNARY_OP_TEST(FIXTURENAME, TESTNAME, OP)
TaylorType c_dtay_
tanh(expr.val())
ScalarT composite1(const ScalarT &a, const ScalarT &b)
CacheTaylor< T > diff(const CacheTaylor< T > &x, int n=1)
Compute Taylor series of n-th derivative of x.
T & fastAccessCoeff(int i)
Returns degree i term without bounds checking.
SimpleFad< ValueT > min(const SimpleFad< ValueT > &a, const SimpleFad< ValueT > &b)
sqrt(expr.val())
#define UNARY_ASSIGNOP_TEST(FIXTURENAME, TESTNAME, OP)
sinh(expr.val())
tan(expr.val())
#define COMPARE_POLYS(x_dtay, x_adolc)
#define BINARY_FUNC_TEST(FIXTURENAME, TESTNAME, FUNC)
TaylorType a_dtay_
#define BINARY_OP_TEST(FIXTURENAME, TESTNAME, OP)
sin(expr.val())
TYPED_TEST_SUITE_P(FadBLASUnitTests)
log(expr.val())
acos(expr.val())
SimpleFad< ValueT > max(const SimpleFad< ValueT > &a, const SimpleFad< ValueT > &b)
SACADO_INLINE_FUNCTION mpl::enable_if_c< ExprLevel< Expr< T1 > >::value==ExprLevel< Expr< T2 > >::value, Expr< PowerOp< Expr< T1 >, Expr< T2 > > > >::type pow(const Expr< T1 > &expr1, const Expr< T2 > &expr2)
TaylorType b_dtay_
exp(expr.val())
fabs(expr.val())
log10(expr.val())
cos(expr.val())
#define UNARY_FUNC_TEST(FIXTURENAME, TESTNAME, FUNC)