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 // Sacado Package
4 //
5 // Copyright 2006 NTESS and the Sacado contributors.
6 // SPDX-License-Identifier: LGPL-2.1-or-later
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TAYLORUNITTESTS_HPP
11 #define TAYLORUNITTESTS_HPP
12 
13 // ADOL-C includes
14 #include "adolc/adouble.h"
15 #include "adolc/interfaces.h"
16 #include "adolc/taping.h"
17 
18 // Sacado includes
19 #include "Sacado_No_Kokkos.hpp"
20 #include "Sacado_Random.hpp"
21 
22 inline adouble max(const adouble& a, const adouble& b) { return fmax(a,b); }
23 inline adouble max(const adouble& a, double v) { return fmax(a,v); }
24 inline adouble max(double v, const adouble& b) { return fmax(v,b); }
25 inline adouble min(const adouble& a, const adouble& b) { return fmin(a,b); }
26 inline adouble min(const adouble& a, double v) { return fmin(a,v); }
27 inline adouble min(double v, const adouble& b) { return fmin(v,b); }
28 
29 // gtest includes
30 #include <gtest/gtest.h>
31 
32 #include "GTestUtils.hpp"
33 
34 #define COMPARE_POLYS(x_dtay, x_adolc) \
35  ASSERT_TRUE(x_dtay.degree() == d); \
36  for (int i=0; i<=d; i++) { \
37  COMPARE_VALUES(x_dtay.coeff(i), x_adolc[i]); \
38  } \
39  ;
40 
41 #define COMPARE_TAYS(x_dtay, y_dtay) \
42  ASSERT_TRUE(x_dtay.degree() == y_dtay.degree()); \
43  for (int i=0; i<=x_dtay.degree(); i++) { \
44  COMPARE_VALUES(x_dtay.coeff(i), y_dtay.coeff(i)); \
45  } \
46  ;
47 
48 // A class for testing each Taylor operation
49 template <class TaylorType>
51 protected:
52 
53  // Taylor variables
55 
56  // ADOL-C arrays
57  double **X_, **Y_;
58 
59  // Random number generator
61 
62  // Degree of polynomials
63  int d_;
64 
65  // Tolerances to which fad objects should be the same
66  double tol_a, tol_r;
67 
69  urand(), d_(5), tol_a(1.0e-11), tol_r(1.0e-10)
70  {
71  X_ = new double*[2];
72  X_[0] = new double[d_+1];
73  X_[1] = new double[d_+1];
74 
75  Y_ = new double*[1];
76  Y_[0] = new double[d_+1];
77  }
78 
80  {
81  delete [] X_[1];
82  delete [] X_[0];
83  delete [] X_;
84 
85  delete [] Y_[0];
86  delete [] Y_;
87  }
88 
89  void SetUp() {
90  double val;
91 
92  a_dtay_ = TaylorType(d_,0.0);
93  b_dtay_ = TaylorType(d_,0.0);
94 
95  for (int i=0; i<=d_; i++) {
96  val = urand.number();
98  X_[0][i] = val;
99 
100  val = urand.number();
102  X_[1][i] = val;
103 
104  Y_[0][i] = 0.0;
105  }
106  }
107 
108  void TearDown() {}
109 
110  template <typename ScalarT>
111  ScalarT composite1(const ScalarT& a, const ScalarT& b) {
112  ScalarT t1 = 3. * a + sin(b) / log(fabs(a - b * 7.));
113  ScalarT t2 = 1.0e3;
114  ScalarT t3 = 5.7e4;
115  ScalarT t4 = 3.2e5;
116  t1 *= cos(a + exp(t1)) / 6. - tan(t1*sqrt(fabs(a * log10(fabs(b)))));
117  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));
118  t1 /= cosh(b - 0.7) + 7.*sinh(t1 + 0.8)*tanh(9./(a+1.)) - 9.;
119  t1 += pow(fabs(a*4.),b-8.)/cos(a*b*a);
120 
121  return t1;
122  }
123 
124  // void print_poly(double *x) {
125  // std::cout.setf(std::ios::fixed,std::ios::floatfield);
126  // std::cout.width(12);
127  // std::cout << "[";
128 
129  // for (int i=0; i<=d_; i++) {
130  // std::cout.width(12);
131  // std::cout << x[i];
132  // }
133 
134  // std::cout << "]\n";
135  // }
136 
137  // void print_diff(const TaylorType& x_dtay, double* x_adolc) {
138  // std::cout.setf(std::ios::fixed,std::ios::floatfield);
139  // std::cout.width(12);
140  // std::cout << "[";
141 
142  // for (int i=0; i<=d_; i++) {
143  // std::cout.width(12);
144  // std::cout << x[i];
145  // }
146 
147  // std::cout << "]\n";
148  // }
149 
150 }; // class TaylorOpsUnitTest
151 
152 // Additional test fixture of max/min since CacheTaylor doesn't implement them
153 template <typename TaylorType>
154 class TaylorMaxMinUnitTest : public TaylorOpsUnitTest< TaylorType > {
155 protected:
158 };
159 
162 
163 #define BINARY_OP2_TEST(FIXTURENAME,TESTNAME,OP) \
164  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
165  auto a_dtay = this->a_dtay_; \
166  auto b_dtay = this->b_dtay_; \
167  auto c_dtay = this->c_dtay_; \
168  auto d = this->d_; \
169  auto X = this->X_; \
170  auto Y = this->Y_; \
171  c_dtay = a_dtay OP b_dtay; \
172  trace_on(0); \
173  adouble aa, ab, ac; \
174  aa <<= X[0][0]; \
175  ab <<= X[1][0]; \
176  ac = aa OP ab; \
177  ac >>= Y[0][0]; \
178  trace_off(); \
179  forward(0,1,2,d,0,X,Y); \
180  COMPARE_POLYS(c_dtay,Y[0]); \
181  }
182 
183 #define BINARY_OPRC_TEST(FIXTURENAME,TESTNAME,OP) \
184  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
185  auto a_dtay = this->a_dtay_; \
186  auto c_dtay = this->c_dtay_; \
187  auto d = this->d_; \
188  auto X = this->X_; \
189  auto Y = this->Y_; \
190  double val = this->urand.number(); \
191  c_dtay = a_dtay OP val; \
192  trace_on(0); \
193  adouble aa, ac; \
194  aa <<= X[0][0]; \
195  ac = aa OP val; \
196  ac >>= Y[0][0]; \
197  trace_off(); \
198  forward(0,1,1,d,0,X,Y); \
199  COMPARE_POLYS(c_dtay,Y[0]); \
200  }
201 
202 #define BINARY_OPLC_TEST(FIXTURENAME,TESTNAME,OP) \
203  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
204  auto a_dtay = this->a_dtay_; \
205  auto c_dtay = this->c_dtay_; \
206  auto d = this->d_; \
207  auto X = this->X_; \
208  auto Y = this->Y_; \
209  double val = this->urand.number(); \
210  c_dtay = val OP a_dtay; \
211  trace_on(0); \
212  adouble aa, ac; \
213  aa <<= X[0][0]; \
214  ac = val OP aa; \
215  ac >>= Y[0][0]; \
216  trace_off(); \
217  forward(0,1,1,d,0,X,Y); \
218  COMPARE_POLYS(c_dtay,Y[0]); \
219  }
220 
221 #define BINARY_OP_TEST(FIXTURENAME,TESTNAME,OP) \
222  BINARY_OP2_TEST(FIXTURENAME,TESTNAME,OP) \
223  BINARY_OPLC_TEST(FIXTURENAME,TESTNAME ## LeftConstant,OP) \
224  BINARY_OPRC_TEST(FIXTURENAME,TESTNAME ## RightConstant,OP)
225 
226 #define RELOP_OP2_TEST(FIXTURENAME,TESTNAME,OP) \
227  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
228  auto a_dtay = this->a_dtay_; \
229  auto b_dtay = this->b_dtay_; \
230  bool r1 = a_dtay OP b_dtay; \
231  bool r2 = a_dtay.coeff(0) OP b_dtay.coeff(0); \
232  ASSERT_TRUE(r1 == r2); \
233  }
234 
235 #define RELOP_OPLC_TEST(FIXTURENAME,TESTNAME,OP) \
236  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
237  auto b_dtay = this->b_dtay_; \
238  double val = this->urand.number(); \
239  bool r1 = val OP b_dtay; \
240  bool r2 = val OP b_dtay.coeff(0); \
241  ASSERT_TRUE(r1 == r2); \
242  }
243 
244 #define RELOP_OPRC_TEST(FIXTURENAME,TESTNAME,OP) \
245  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
246  auto a_dtay = this->b_dtay_; \
247  double val = this->urand.number(); \
248  bool r1 = a_dtay OP val; \
249  bool r2 = a_dtay.coeff(0) OP val; \
250  ASSERT_TRUE(r1 == r2); \
251  }
252 
253 #define RELOP_OP_TEST(FIXTURENAME,TESTNAME,OP) \
254  RELOP_OP2_TEST(FIXTURENAME,TESTNAME,OP) \
255  RELOP_OPLC_TEST(FIXTURENAME,TESTNAME ## LeftConstant,OP) \
256  RELOP_OPRC_TEST(FIXTURENAME,TESTNAME ## RightConstant,OP)
257 
258 #define BINARY_FUNC2_TEST(FIXTURENAME,TESTNAME,FUNC) \
259  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
260  auto a_dtay = this->a_dtay_; \
261  auto b_dtay = this->b_dtay_; \
262  auto c_dtay = this->c_dtay_; \
263  auto d = this->d_; \
264  auto X = this->X_; \
265  auto Y = this->Y_; \
266  c_dtay = FUNC (a_dtay, b_dtay); \
267  trace_on(0); \
268  adouble aa, ab, ac; \
269  aa <<= X[0][0]; \
270  ab <<= X[1][0]; \
271  ac = FUNC (aa, ab); \
272  ac >>= Y[0][0]; \
273  trace_off(); \
274  forward(0,1,2,d,0,X,Y); \
275  COMPARE_POLYS(c_dtay,Y[0]); \
276  }
277 
278 #define BINARY_FUNCRC_TEST(FIXTURENAME,TESTNAME,FUNC) \
279  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
280  auto a_dtay = this->a_dtay_; \
281  auto c_dtay = this->c_dtay_; \
282  auto d = this->d_; \
283  auto X = this->X_; \
284  auto Y = this->Y_; \
285  double val = this->urand.number(); \
286  c_dtay = FUNC (a_dtay, val); \
287  trace_on(0); \
288  adouble aa, ac; \
289  aa <<= X[0][0]; \
290  ac = FUNC (aa, val); \
291  ac >>= Y[0][0]; \
292  trace_off(); \
293  forward(0,1,1,d,0,X,Y); \
294  COMPARE_POLYS(c_dtay,Y[0]); \
295  }
296 
297 #define BINARY_FUNCLC_TEST(FIXTURENAME,TESTNAME,FUNC) \
298  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
299  auto a_dtay = this->a_dtay_; \
300  auto c_dtay = this->c_dtay_; \
301  auto d = this->d_; \
302  auto X = this->X_; \
303  auto Y = this->Y_; \
304  double val = this->urand.number(); \
305  c_dtay = FUNC (val, a_dtay); \
306  trace_on(0); \
307  adouble aa, ac; \
308  aa <<= X[0][0]; \
309  ac = FUNC (val, aa); \
310  ac >>= Y[0][0]; \
311  trace_off(); \
312  forward(0,1,1,d,0,X,Y); \
313  COMPARE_POLYS(c_dtay,Y[0]); \
314  }
315 
316 #define BINARY_FUNC_TEST(FIXTURENAME,TESTNAME,FUNC) \
317  BINARY_FUNC2_TEST(FIXTURENAME,TESTNAME,FUNC) \
318  BINARY_FUNCLC_TEST(FIXTURENAME,TESTNAME ## LeftConstant,FUNC) \
319  BINARY_FUNCRC_TEST(FIXTURENAME,TESTNAME ## RightConstant,FUNC)
320 
321 #define UNARY_OP_TEST(FIXTURENAME,TESTNAME,OP) \
322  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
323  auto a_dtay = this->a_dtay_; \
324  auto c_dtay = this->c_dtay_; \
325  auto d = this->d_; \
326  auto X = this->X_; \
327  auto Y = this->Y_; \
328  c_dtay = OP a_dtay; \
329  trace_on(0); \
330  adouble aa, ac; \
331  aa <<= X[0][0]; \
332  ac = OP aa; \
333  ac >>= Y[0][0]; \
334  trace_off(); \
335  forward(0,1,1,d,0,X,Y); \
336  COMPARE_POLYS(c_dtay,Y[0]); \
337  }
338 
339 #define UNARY_FUNC_TEST(FIXTURENAME,TESTNAME,FUNC) \
340  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
341  auto a_dtay = this->a_dtay_; \
342  auto c_dtay = this->c_dtay_; \
343  auto d = this->d_; \
344  auto X = this->X_; \
345  auto Y = this->Y_; \
346  c_dtay = FUNC (a_dtay); \
347  trace_on(0); \
348  adouble aa, ac; \
349  aa <<= X[0][0]; \
350  ac = FUNC (aa); \
351  ac >>= Y[0][0]; \
352  trace_off(); \
353  forward(0,1,1,d,0,X,Y); \
354  COMPARE_POLYS(c_dtay,Y[0]); \
355  }
356 
357 #define UNARY_ASSIGNOP2_TEST(FIXTURENAME,TESTNAME,OP) \
358  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
359  auto a_dtay = this->a_dtay_; \
360  auto b_dtay = this->b_dtay_; \
361  auto c_dtay = this->c_dtay_; \
362  auto d = this->d_; \
363  auto X = this->X_; \
364  auto Y = this->Y_; \
365  c_dtay = a_dtay; \
366  c_dtay OP b_dtay; \
367  trace_on(0); \
368  adouble aa, ab, ac; \
369  aa <<= X[0][0]; \
370  ab <<= X[1][0]; \
371  ac = aa; \
372  ac OP ab; \
373  ac >>= Y[0][0]; \
374  trace_off(); \
375  forward(0,1,2,d,0,X,Y); \
376  COMPARE_POLYS(c_dtay,Y[0]); \
377  }
378 
379 #define UNARY_ASSIGNOPRC_TEST(FIXTURENAME,TESTNAME,OP) \
380  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
381  auto a_dtay = this->a_dtay_; \
382  auto c_dtay = this->c_dtay_; \
383  auto d = this->d_; \
384  auto X = this->X_; \
385  auto Y = this->Y_; \
386  double val = this->urand.number(); \
387  c_dtay = a_dtay; \
388  c_dtay OP val; \
389  trace_on(0); \
390  adouble aa, ac; \
391  aa <<= X[0][0]; \
392  ac = aa; \
393  ac OP val; \
394  ac >>= Y[0][0]; \
395  trace_off(); \
396  forward(0,1,1,d,0,X,Y); \
397  COMPARE_POLYS(c_dtay,Y[0]); \
398  }
399 
400 #define UNARY_ASSIGNOPLC_TEST(FIXTURENAME,TESTNAME,OP) \
401  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
402  auto a_dtay = this->a_dtay_; \
403  auto c_dtay = this->c_dtay_; \
404  auto d = this->d_; \
405  auto X = this->X_; \
406  auto Y = this->Y_; \
407  double val = this->urand.number(); \
408  c_dtay = val; \
409  c_dtay OP a_dtay; \
410  trace_on(0); \
411  adouble aa, ac; \
412  aa <<= X[0][0]; \
413  ac = val; \
414  ac OP aa; \
415  ac >>= Y[0][0]; \
416  trace_off(); \
417  forward(0,1,1,d,0,X,Y); \
418  COMPARE_POLYS(c_dtay,Y[0]); \
419  }
420 
421 #define UNARY_ASSIGNOP_TEST(FIXTURENAME,TESTNAME,OP) \
422  UNARY_ASSIGNOP2_TEST(FIXTURENAME,TESTNAME,OP) \
423  UNARY_ASSIGNOPLC_TEST(FIXTURENAME,TESTNAME ## LeftConstant,OP) \
424  UNARY_ASSIGNOPRC_TEST(FIXTURENAME,TESTNAME ## RightConstant,OP)
425 
426 BINARY_OP_TEST(TaylorOpsUnitTest, testAddition, +)
427 BINARY_OP_TEST(TaylorOpsUnitTest, testSubtraction, -)
428 BINARY_OP_TEST(TaylorOpsUnitTest, testMultiplication, *)
429 BINARY_OP_TEST(TaylorOpsUnitTest, testDivision, /)
430 
431 RELOP_OP_TEST(TaylorOpsUnitTest, testEquals, ==)
432 RELOP_OP_TEST(TaylorOpsUnitTest, testNotEquals, !=)
433 RELOP_OP_TEST(TaylorOpsUnitTest, testLessThanOrEquals, <=)
434 RELOP_OP_TEST(TaylorOpsUnitTest, testGreaterThanOrEquals, >=)
435 RELOP_OP_TEST(TaylorOpsUnitTest, testLessThan, <)
436 RELOP_OP_TEST(TaylorOpsUnitTest, testGreaterThan, >)
437 
438 BINARY_FUNC_TEST(TaylorOpsUnitTest, testPow, pow)
439 
440 UNARY_OP_TEST(TaylorOpsUnitTest, testUnaryPlus, +)
441 UNARY_OP_TEST(TaylorOpsUnitTest, testUnaryMinus, -)
442 
443 UNARY_FUNC_TEST(TaylorOpsUnitTest, testExp, exp)
444 UNARY_FUNC_TEST(TaylorOpsUnitTest, testLog, log)
445 UNARY_FUNC_TEST(TaylorOpsUnitTest, testLog10, log10)
446 UNARY_FUNC_TEST(TaylorOpsUnitTest, testSqrt, sqrt)
447 UNARY_FUNC_TEST(TaylorOpsUnitTest, testCos, cos)
448 UNARY_FUNC_TEST(TaylorOpsUnitTest, testSin, sin)
449 UNARY_FUNC_TEST(TaylorOpsUnitTest, testTan, tan)
450 UNARY_FUNC_TEST(TaylorOpsUnitTest, testACos, acos)
451 UNARY_FUNC_TEST(TaylorOpsUnitTest, testASin, asin)
452 UNARY_FUNC_TEST(TaylorOpsUnitTest, testATan, atan)
453 UNARY_FUNC_TEST(TaylorOpsUnitTest, testCosh, cosh)
454 UNARY_FUNC_TEST(TaylorOpsUnitTest, testSinh, sinh)
455 UNARY_FUNC_TEST(TaylorOpsUnitTest, testTanh, tanh)
456 UNARY_FUNC_TEST(TaylorOpsUnitTest, testFAbs, fabs)
457 
458 UNARY_ASSIGNOP_TEST(TaylorOpsUnitTest, testPlusEquals, +=)
459 UNARY_ASSIGNOP_TEST(TaylorOpsUnitTest, testMinusEquals, -=)
460 UNARY_ASSIGNOP_TEST(TaylorOpsUnitTest, testTimesEquals, *=)
461 UNARY_ASSIGNOP_TEST(TaylorOpsUnitTest, testDivideEquals, /=)
462 
463 TYPED_TEST_P(TaylorOpsUnitTest, testComposite1) {
464  auto a_dtay = this->a_dtay_;
465  auto b_dtay = this->b_dtay_;
466  auto c_dtay = this->c_dtay_;
467  auto d = this->d_;
468  auto X = this->X_;
469  auto Y = this->Y_;
470  c_dtay = this->composite1(a_dtay, b_dtay);
471  trace_on(0);
472  adouble aa, ab, ac;
473  aa <<= X[0][0];
474  ab <<= X[1][0];
475  ac = this->composite1(aa,ab);
476  ac >>= Y[0][0];
477  trace_off();
478  forward(0,1,2,d,0,X,Y);
479  COMPARE_POLYS(c_dtay,Y[0]);
480 }
481 
483  typedef decltype(this->a_dtay_) TaylorType;
484  auto a_dtay = this->a_dtay_;
485  auto d = this->d_;
486  TaylorType a_diff1 = diff(a_dtay);
487  TaylorType a_diff2(d-1, 0.0);
488  for (int i=1; i<=d; ++i)
489  a_diff2.fastAccessCoeff(i-1) = a_dtay.fastAccessCoeff(i)*i;
490  COMPARE_TAYS(a_diff1, a_diff2);
491 }
492 
494  typedef decltype(this->a_dtay_) TaylorType;
495  auto a_dtay = this->a_dtay_;
496  TaylorType a_diff1 = diff(a_dtay, 3);
497  TaylorType a_diff2 = diff( diff( diff(a_dtay) ) );
498  COMPARE_TAYS(a_diff1, a_diff2);
499 }
500 
503  testAddition,
504  testAdditionLeftConstant,
505  testAdditionRightConstant,
506  testSubtraction,
507  testSubtractionLeftConstant,
508  testSubtractionRightConstant,
509  testMultiplication,
510  testMultiplicationLeftConstant,
511  testMultiplicationRightConstant,
512  testDivision,
513  testDivisionLeftConstant,
514  testDivisionRightConstant,
515  testEquals,
516  testEqualsLeftConstant,
517  testEqualsRightConstant,
518  testNotEquals,
519  testNotEqualsLeftConstant,
520  testNotEqualsRightConstant,
521  testLessThanOrEquals,
522  testLessThanOrEqualsLeftConstant,
523  testLessThanOrEqualsRightConstant,
524  testGreaterThanOrEquals,
525  testGreaterThanOrEqualsLeftConstant,
526  testGreaterThanOrEqualsRightConstant,
527  testLessThan,
528  testLessThanLeftConstant,
529  testLessThanRightConstant,
530  testGreaterThan,
531  testGreaterThanLeftConstant,
532  testGreaterThanRightConstant,
533  testUnaryPlus,
534  testUnaryMinus,
535  testExp,
536  testLog,
537  testLog10,
538  testSqrt,
539  testCos,
540  testSin,
541  testTan,
542  testACos,
543  testASin,
544  testATan,
545  testCosh,
546  testSinh,
547  testTanh,
548  testFAbs,
549  testPlusEquals,
550  testPlusEqualsLeftConstant,
551  testPlusEqualsRightConstant,
552  testMinusEquals,
553  testMinusEqualsLeftConstant,
554  testMinusEqualsRightConstant,
555  testTimesEquals,
556  testTimesEqualsLeftConstant,
557  testTimesEqualsRightConstant,
558  testDivideEquals,
559  testDivideEqualsLeftConstant,
560  testDivideEqualsRightConstant,
561  testPow,
562  testPowLeftConstant,
563  testPowRightConstant,
564  testComposite1,
565  testDiff1,
566  testDiff3);
567 
570 
572  TaylorMaxMinUnitTest,
573  testMax,
574  testMaxLeftConstant,
575  testMaxRightConstant,
576  testMin,
577  testMinLeftConstant,
578  testMinRightConstant);
579 
580 #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)