Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FadUnitTests.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 FADUNITTESTS_HPP
11 #define FADUNITTESTS_HPP
12 
13 // Sacado includes
14 #include "Sacado_No_Kokkos.hpp"
15 #include "Sacado_Random.hpp"
16 
17 // Fad includes
18 #include "Fad/fad.h"
19 
20 // gtest includes
21 #include <gtest/gtest.h>
22 
23 #include "GTestUtils.hpp"
24 
25 // A class for testing each Fad operation
26 template <typename FadType>
28 protected:
30 
31  // DFad variables
33 
34  // Fad variables
35  FAD::Fad<ScalarType> a_fad_, b_fad_, c_fad_;
36 
37  // Random number generator
39 
40  // Number of derivative components
41  int n;
42 
43  // Tolerances to which fad objects should be the same
45 
46  FadOpsUnitTest() : urand(), n(5), tol_a(1.0e-15), tol_r(1.0e-12) {}
47 
48  void SetUp() override {
50 
51  val = urand.number();
52  a_dfad_ = FadType(n,val);
53  a_fad_ = FAD::Fad<ScalarType>(n,val);
54 
55  val = urand.number();
56  b_dfad_ = FadType(n,val);
57  b_fad_ = FAD::Fad<ScalarType>(n,val);
58 
59  for (int i=0; i<n; i++) {
60  val = urand.number();
61  a_dfad_.fastAccessDx(i) = val;
62  a_fad_.fastAccessDx(i) = val;
63 
64  val = urand.number();
65  b_dfad_.fastAccessDx(i) = val;
66  b_fad_.fastAccessDx(i) = val;
67  }
68 
69  val = 0.0;
70  c_dfad_ = FadType(n, val);
71  c_fad_ = FAD::Fad<ScalarType>(n,val);
72  }
73 
74  void TearDown() override {}
75 
76  template <typename ScalarT>
77  ScalarT composite1(const ScalarT& a, const ScalarT& b) {
78  ScalarT t1 = 3. * a + sin(b) / log(fabs(a - b * 7.));
79  ScalarT t2 = 1.0e3;
80  ScalarT t3 = 5.7e4;
81  ScalarT t4 = 3.2e5;
82  t1 *= cos(a + exp(t1)) / 6. - tan(t1*sqrt(abs(a * log10(abs(b)))));
83  t1 -= acos((6.+asin(pow(fabs(a),b)/t2))/t3) * asin(pow(fabs(b),2.)*1.0/t4) * atan((b*pow(2.,log(abs(a))))/(t3*t4));
84  t1 /= cosh(b - 0.7) + 7.*sinh(t1 + 0.8)*tanh(9./a) - 9.;
85  t1 += pow(abs(a*4.),b-8.)/cos(a*b*a);
86 
87  return t1;
88  }
89 
90 }; // class FadOpsUnitTest
91 
93 
94 #define BINARY_OP_TEST(FIXTURENAME,TESTNAME,OP) \
95  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
96  auto a_dfad = this->a_dfad_; \
97  auto b_dfad = this->b_dfad_; \
98  auto c_dfad = this->c_dfad_; \
99  auto a_fad = this->a_fad_; \
100  auto b_fad = this->b_fad_; \
101  auto c_fad = this->c_fad_; \
102  c_dfad = a_dfad OP b_dfad; \
103  c_fad = a_fad OP b_fad; \
104  COMPARE_FADS(c_dfad, c_fad); \
105  \
106  double val = this->urand.number(); \
107  c_dfad = a_dfad OP val; \
108  c_fad = a_fad OP val; \
109  COMPARE_FADS(c_dfad, c_fad); \
110  \
111  c_dfad = val OP b_dfad; \
112  c_fad = val OP b_fad; \
113  COMPARE_FADS(c_dfad, c_fad); \
114  }
115 
116 #define RELOP_TEST(FIXTURENAME,TESTNAME,OP) \
117  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
118  auto a_dfad = this->a_dfad_; \
119  auto b_dfad = this->b_dfad_; \
120  auto a_fad = this->a_fad_; \
121  auto b_fad = this->b_fad_; \
122  bool r1 = a_dfad OP b_dfad; \
123  bool r2 = a_fad OP b_fad; \
124  ASSERT_TRUE(r1 == r2); \
125  \
126  double val = this->urand.number(); \
127  r1 = a_dfad OP val; \
128  r2 = a_fad OP val; \
129  ASSERT_TRUE(r1 == r2); \
130  \
131  r1 = val OP b_dfad; \
132  r2 = val OP b_fad; \
133  ASSERT_TRUE(r1 == r2); \
134  }
135 
136 #define BINARY_FUNC_TEST(FIXTURENAME,TESTNAME,FUNC) \
137  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
138  auto a_dfad = this->a_dfad_; \
139  auto b_dfad = this->b_dfad_; \
140  auto c_dfad = this->c_dfad_; \
141  auto a_fad = this->a_fad_; \
142  auto b_fad = this->b_fad_; \
143  auto c_fad = this->c_fad_; \
144  c_dfad = FUNC (a_dfad,b_dfad); \
145  c_fad = FUNC (a_fad,b_fad); \
146  COMPARE_FADS(c_dfad, c_fad); \
147  \
148  double val = this->urand.number(); \
149  c_dfad = FUNC (a_dfad,val); \
150  c_fad = FUNC (a_fad,val); \
151  COMPARE_FADS(c_dfad, c_fad); \
152  \
153  c_dfad = FUNC (val,b_dfad); \
154  c_fad = FUNC (val,b_fad); \
155  COMPARE_FADS(c_dfad, c_fad); \
156  }
157 
158 #define UNARY_OP_TEST(FIXTURENAME,TESTNAME,OP) \
159  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
160  auto a_dfad = this->a_dfad_; \
161  auto c_dfad = this->c_dfad_; \
162  auto a_fad = this->a_fad_; \
163  auto c_fad = this->c_fad_; \
164  c_dfad = OP a_dfad; \
165  c_fad = OP a_fad; \
166  COMPARE_FADS(c_dfad, c_fad); \
167  }
168 
169 #define UNARY_FUNC_TEST(FIXTURENAME,TESTNAME,FUNC) \
170  TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
171  auto a_dfad = this->a_dfad_; \
172  auto c_dfad = this->c_dfad_; \
173  auto a_fad = this->a_fad_; \
174  auto c_fad = this->c_fad_; \
175  c_dfad = FUNC (a_dfad); \
176  c_fad = FUNC (a_fad); \
177  COMPARE_FADS(c_dfad, c_fad); \
178  }
179 
180 #define UNARY_ASSIGNOP_TEST(FIXTURENAME,TESTNAME,OP) \
181  TYPED_TEST_P(FIXTURENAME, TESTNAME){ \
182  auto a_dfad = this->a_dfad_; \
183  auto b_dfad = this->b_dfad_; \
184  auto c_dfad = this->c_dfad_; \
185  auto a_fad = this->a_fad_; \
186  auto b_fad = this->b_fad_; \
187  auto c_fad = this->c_fad_; \
188  c_dfad = b_dfad; \
189  c_fad = b_fad; \
190  c_dfad OP a_dfad; \
191  c_fad OP a_fad; \
192  COMPARE_FADS(c_dfad, c_fad); \
193  \
194  double val = this->urand.number(); \
195  c_dfad OP val; \
196  c_fad OP val; \
197  COMPARE_FADS(c_dfad, c_fad); \
198  }
199 
200 BINARY_OP_TEST(FadOpsUnitTest, testAddition, +)
201 BINARY_OP_TEST(FadOpsUnitTest, testSubtraction, -)
202 BINARY_OP_TEST(FadOpsUnitTest, testMultiplication, *)
203 BINARY_OP_TEST(FadOpsUnitTest, testDivision, /)
204 
205 RELOP_TEST(FadOpsUnitTest, testEquals, ==)
206 RELOP_TEST(FadOpsUnitTest, testNotEquals, !=)
207 RELOP_TEST(FadOpsUnitTest, testLessThanOrEquals, <=)
208 RELOP_TEST(FadOpsUnitTest, testGreaterThanOrEquals, >=)
209 RELOP_TEST(FadOpsUnitTest, testLessThan, <)
210 RELOP_TEST(FadOpsUnitTest, testGreaterThan, >)
211 
212 BINARY_FUNC_TEST(FadOpsUnitTest, testPow, pow)
213 
214 UNARY_OP_TEST(FadOpsUnitTest, testUnaryPlus, +)
215 UNARY_OP_TEST(FadOpsUnitTest, testUnaryMinus, -)
216 
217 UNARY_FUNC_TEST(FadOpsUnitTest, testExp, exp)
218 UNARY_FUNC_TEST(FadOpsUnitTest, testLog, log)
219 UNARY_FUNC_TEST(FadOpsUnitTest, testLog10, log10)
220 UNARY_FUNC_TEST(FadOpsUnitTest, testSqrt, sqrt)
221 UNARY_FUNC_TEST(FadOpsUnitTest, testCos, cos)
222 UNARY_FUNC_TEST(FadOpsUnitTest, testSin, sin)
223 UNARY_FUNC_TEST(FadOpsUnitTest, testTan, tan)
224 UNARY_FUNC_TEST(FadOpsUnitTest, testACos, acos)
225 UNARY_FUNC_TEST(FadOpsUnitTest, testASin, asin)
226 UNARY_FUNC_TEST(FadOpsUnitTest, testATan, atan)
227 UNARY_FUNC_TEST(FadOpsUnitTest, testCosh, cosh)
228 UNARY_FUNC_TEST(FadOpsUnitTest, testSinh, sinh)
229 UNARY_FUNC_TEST(FadOpsUnitTest, testTanh, tanh)
230 UNARY_FUNC_TEST(FadOpsUnitTest, testAbs, abs)
231 UNARY_FUNC_TEST(FadOpsUnitTest, testFAbs, fabs)
232 
233 UNARY_ASSIGNOP_TEST(FadOpsUnitTest, testPlusEquals, +=)
234 UNARY_ASSIGNOP_TEST(FadOpsUnitTest, testMinusEquals, -=)
235 UNARY_ASSIGNOP_TEST(FadOpsUnitTest, testTimesEquals, *=)
236 UNARY_ASSIGNOP_TEST(FadOpsUnitTest, testDivideEquals, /=)
237 
238 TYPED_TEST_P(FadOpsUnitTest, testMax) {
239  typedef decltype(this->a_dfad_) FadType;
240  typedef typename Sacado::ScalarType<FadType>::type ScalarType;
241 
242  ScalarType val;
243 
244  auto a_dfad = this->a_dfad_;
245  auto b_dfad = this->b_dfad_;
246  auto c_dfad = this->c_dfad_;
247  auto a_fad = this->a_fad_;
248  auto b_fad = this->b_fad_;
249  auto c_fad = this->c_fad_;
250 
251  FadType aa_dfad = a_dfad + 1.0;
252  c_dfad = max(aa_dfad, a_dfad);
253  COMPARE_VALUES(c_dfad.val(), aa_dfad.val());
254  for (int i=0; i<this->n; i++) {
255  COMPARE_VALUES(c_dfad.dx(i), aa_dfad.dx(i));
256  COMPARE_VALUES(c_dfad.fastAccessDx(i), aa_dfad.fastAccessDx(i));
257  }
258 
259  c_dfad = max(a_dfad, aa_dfad);
260  COMPARE_VALUES(c_dfad.val(), aa_dfad.val());
261  for (int i=0; i<this->n; i++) {
262  COMPARE_VALUES(c_dfad.dx(i), aa_dfad.dx(i));
263  COMPARE_VALUES(c_dfad.fastAccessDx(i), aa_dfad.fastAccessDx(i));
264  }
265 
266  c_dfad = max(a_dfad+1.0, a_dfad);
267  COMPARE_VALUES(c_dfad.val(), aa_dfad.val());
268  for (int i=0; i<this->n; i++) {
269  COMPARE_VALUES(c_dfad.dx(i), aa_dfad.dx(i));
270  COMPARE_VALUES(c_dfad.fastAccessDx(i), aa_dfad.fastAccessDx(i));
271  }
272 
273  c_dfad = max(a_dfad, a_dfad+1.0);
274  COMPARE_VALUES(c_dfad.val(), aa_dfad.val());
275  for (int i=0; i<this->n; i++) {
276  COMPARE_VALUES(c_dfad.dx(i), aa_dfad.dx(i));
277  COMPARE_VALUES(c_dfad.fastAccessDx(i), aa_dfad.fastAccessDx(i));
278  }
279 
280  val = a_dfad.val() + 1;
281  c_dfad = max(a_dfad, val);
282  COMPARE_VALUES(c_dfad.val(), val);
283  for (int i=0; i<this->n; i++)
284  COMPARE_VALUES(c_dfad.dx(i), 0.0);
285 
286  val = a_dfad.val() - 1;
287  c_dfad = max(a_dfad, val);
288  COMPARE_VALUES(c_dfad.val(), a_dfad.val());
289  for (int i=0; i<this->n; i++) {
290  COMPARE_VALUES(c_dfad.dx(i), a_dfad.dx(i));
291  COMPARE_VALUES(c_dfad.fastAccessDx(i), a_dfad.fastAccessDx(i));
292  }
293 
294  val = b_dfad.val() + 1;
295  c_dfad = max(val, b_dfad);
296  COMPARE_VALUES(c_dfad.val(), val);
297  for (int i=0; i<this->n; i++)
298  COMPARE_VALUES(c_dfad.dx(i), 0.0);
299 
300  val = b_dfad.val() - 1;
301  c_dfad = max(val, b_dfad);
302  COMPARE_VALUES(c_dfad.val(), b_dfad.val());
303  for (int i=0; i<this->n; i++) {
304  COMPARE_VALUES(c_dfad.dx(i), b_dfad.dx(i));
305  COMPARE_VALUES(c_dfad.fastAccessDx(i), b_dfad.fastAccessDx(i));
306  }
307 }
308 
310  typedef decltype(this->a_dfad_) FadType;
311  typedef typename Sacado::ScalarType<FadType>::type ScalarType;
312 
313  ScalarType val;
314 
315  auto a_dfad = this->a_dfad_;
316  auto b_dfad = this->b_dfad_;
317  auto c_dfad = this->c_dfad_;
318  auto a_fad = this->a_fad_;
319  auto b_fad = this->b_fad_;
320  auto c_fad = this->c_fad_;
321 
322  FadType aa_dfad = a_dfad - 1.0;
323  c_dfad = min(aa_dfad, a_dfad);
324  COMPARE_VALUES(c_dfad.val(), aa_dfad.val());
325  for (int i=0; i<this->n; i++) {
326  COMPARE_VALUES(c_dfad.dx(i), aa_dfad.dx(i));
327  COMPARE_VALUES(c_dfad.fastAccessDx(i), aa_dfad.fastAccessDx(i));
328  }
329 
330  c_dfad = min(a_dfad, aa_dfad);
331  COMPARE_VALUES(c_dfad.val(), aa_dfad.val());
332  for (int i=0; i<this->n; i++) {
333  COMPARE_VALUES(c_dfad.dx(i), aa_dfad.dx(i));
334  COMPARE_VALUES(c_dfad.fastAccessDx(i), aa_dfad.fastAccessDx(i));
335  }
336 
337  val = a_dfad.val() - 1;
338  c_dfad = min(a_dfad, val);
339  COMPARE_VALUES(c_dfad.val(), val);
340  for (int i=0; i<this->n; i++)
341  COMPARE_VALUES(c_dfad.dx(i), 0.0);
342 
343  val = a_dfad.val() + 1;
344  c_dfad = min(a_dfad, val);
345  COMPARE_VALUES(c_dfad.val(), a_dfad.val());
346  for (int i=0; i<this->n; i++) {
347  COMPARE_VALUES(c_dfad.dx(i), a_dfad.dx(i));
348  COMPARE_VALUES(c_dfad.fastAccessDx(i), a_dfad.fastAccessDx(i));
349  }
350 
351  val = b_dfad.val() - 1;
352  c_dfad = min(val, b_dfad);
353  COMPARE_VALUES(c_dfad.val(), val);
354  for (int i=0; i<this->n; i++)
355  COMPARE_VALUES(c_dfad.dx(i), 0.0);
356 
357  val = b_dfad.val() + 1;
358  c_dfad = min(val, b_dfad);
359  COMPARE_VALUES(c_dfad.val(), b_dfad.val());
360  for (int i=0; i<this->n; i++) {
361  COMPARE_VALUES(c_dfad.dx(i), b_dfad.dx(i));
362  COMPARE_VALUES(c_dfad.fastAccessDx(i), b_dfad.fastAccessDx(i));
363  }
364 }
365 
366 TYPED_TEST_P(FadOpsUnitTest, testComposite1) {
367  auto a_dfad = this->a_dfad_;
368  auto b_dfad = this->b_dfad_;
369  auto c_dfad = this->c_dfad_;
370  auto a_fad = this->a_fad_;
371  auto b_fad = this->b_fad_;
372  auto c_fad = this->c_fad_;
373 
374  c_dfad = this->composite1(a_dfad, b_dfad);
375  c_fad = this->composite1(a_fad, b_fad);
376  COMPARE_FADS(c_dfad, c_fad);
377 }
378 
380  typedef decltype(this->a_dfad_) FadType;
381  typedef typename Sacado::ScalarType<FadType>::type ScalarType;
382 
383  auto a_dfad = this->a_dfad_;
384  auto b_dfad = this->b_dfad_;
385  auto a_fad = this->a_fad_;
386  auto b_fad = this->b_fad_;
387 
388  FadType aa_dfad = a_dfad;
389  FAD::Fad<ScalarType> aa_fad = a_fad;
390  aa_dfad = 1.0;
391  aa_fad = 1.0;
392  aa_dfad = aa_dfad + b_dfad;
393  aa_fad = aa_fad + b_fad;
394  COMPARE_FADS(aa_dfad, aa_fad);
395 }
396 
398  typedef decltype(this->a_dfad_) FadType;
399  typedef typename Sacado::ScalarType<FadType>::type ScalarType;
400 
401  auto a_dfad = this->a_dfad_;
402  auto b_dfad = this->b_dfad_;
403  auto a_fad = this->a_fad_;
404  auto b_fad = this->b_fad_;
405 
406  FadType aa_dfad = a_dfad;
407  FAD::Fad<ScalarType> aa_fad = a_fad;
408  aa_dfad = 1.0;
409  aa_fad = 1.0;
410  aa_dfad = aa_dfad - b_dfad;
411  aa_fad = aa_fad - b_fad;
412  COMPARE_FADS(aa_dfad, aa_fad);
413 }
414 
416  typedef decltype(this->a_dfad_) FadType;
417  typedef typename Sacado::ScalarType<FadType>::type ScalarType;
418 
419  auto a_dfad = this->a_dfad_;
420  auto b_dfad = this->b_dfad_;
421  auto a_fad = this->a_fad_;
422  auto b_fad = this->b_fad_;
423 
424  FadType aa_dfad = a_dfad;
425  FAD::Fad<ScalarType> aa_fad = a_fad;
426  aa_dfad = 2.0;
427  aa_fad = 2.0;
428  aa_dfad = aa_dfad * b_dfad;
429  aa_fad = aa_fad * b_fad;
430  COMPARE_FADS(aa_dfad, aa_fad);
431 }
432 
433 TYPED_TEST_P(FadOpsUnitTest, testDivideLR) {
434  typedef decltype(this->a_dfad_) FadType;
435  typedef typename Sacado::ScalarType<FadType>::type ScalarType;
436 
437  auto a_dfad = this->a_dfad_;
438  auto b_dfad = this->b_dfad_;
439  auto a_fad = this->a_fad_;
440  auto b_fad = this->b_fad_;
441 
442  FadType aa_dfad = a_dfad;
443  FAD::Fad<ScalarType> aa_fad = a_fad;
444  aa_dfad = 2.0;
445  aa_fad = 2.0;
446  aa_dfad = aa_dfad / b_dfad;
447  aa_fad = aa_fad / b_fad;
448  COMPARE_FADS(aa_dfad, aa_fad);
449 }
450 
451  // Check various corner cases for pow()
452 TYPED_TEST_P(FadOpsUnitTest, testPowConstB) {
453  typedef decltype(this->a_dfad_) FadType;
454 
455  FadType a, b, c, cc;
456 
457  // Constant b
458  a = FadType(this->n,1.2345);
459  for (int i=0; i<this->n; ++i)
460  a.fastAccessDx(i) = this->urand.number();
461  b = 3.456;
462  c = pow(a, b);
463  cc = FadType(this->n, pow(a.val(),b.val()));
464  for (int i=0; i<this->n; ++i)
465  cc.fastAccessDx(i) = b.val()*pow(a.val(),b.val()-1)*a.dx(i);
466  COMPARE_FADS(c, cc);
467 
468  // Constant scalar b
469  c = pow(a, b.val());
470  COMPARE_FADS(c, cc);
471 
472  // Constant b == 0
473  b = 0.0;
474  c = pow(a, b);
475  cc.val() = 1.0;
476  for (int i=0; i<this->n; ++i)
477  cc.fastAccessDx(i) = 0.0;
478  COMPARE_FADS(c, cc);
479 
480  // Constant scalar b == 0
481  c = pow(a, b.val());
482  COMPARE_FADS(c, cc);
483 
484  // a == 0 and constant b
485  a.val() = 0.0;
486  b = 3.456;
487  c = pow(a, b);
488  cc.val() = 0.0;
489  for (int i=0; i<this->n; ++i)
490  cc.fastAccessDx(i) = 0.0;
491  COMPARE_FADS(c, cc);
492 
493  // a == 0 and constant scalar b
494  c = pow(a, b.val());
495  COMPARE_FADS(c, cc);
496 
497  // a == 0 and b == 0
498  b = 0.0;
499  c = pow(a, b);
500  cc.val() = 1.0;
501  for (int i=0; i<this->n; ++i)
502  cc.fastAccessDx(i) = 0.0;
503  COMPARE_FADS(c, cc);
504 
505  // a == 0 and scalar b == 0
506  c = pow(a, b.val());
507  COMPARE_FADS(c, cc);
508 
509  // a == 0 and b == 1
510  b = 1.0;
511  c = pow(a, b);
512  cc = a;
514  COMPARE_FADS(c, cc);
515  }
516  c = pow(a, b.val());
517  COMPARE_FADS(c, cc);
518 
519  // a == 0 and b == 2
520  b = 2.0;
521  c = pow(a, b);
522  cc = a*a;
524  COMPARE_FADS(c, cc);
525  }
526  c = pow(a, b.val());
527  COMPARE_FADS(c, cc);
528 }
529 
532  testAddition,
533  testSubtraction,
534  testMultiplication,
535  testDivision,
536  testEquals,
537  testNotEquals,
538  testLessThanOrEquals,
539  testGreaterThanOrEquals,
540  testLessThan,
541  testGreaterThan,
542  testPow,
543  testUnaryPlus,
544  testUnaryMinus,
545  testExp,
546  testLog,
547  testLog10,
548  testSqrt,
549  testCos,
550  testSin,
551  testTan,
552  testACos,
553  testASin,
554  testATan,
555  testCosh,
556  testSinh,
557  testTanh,
558  testAbs,
559  testFAbs,
560  testPlusEquals,
561  testMinusEquals,
562  testTimesEquals,
563  testDivideEquals,
564  testMax,
565  testMin,
566  testComposite1,
567  testPlusLR,
568  testMinusLR,
569  testTimesLR,
570  testDivideLR,
571  testPowConstB);
572 
573 #endif // FADUNITTESTS_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())
FAD::Fad< ScalarType > c_fad_
cosh(expr.val())
abs(expr.val())
TYPED_TEST_P(FadBLASUnitTests, testSCAL1)
#define COMPARE_VALUES(a, b)
Definition: GTestUtils.hpp:89
Sacado::Fad::DFad< double > FadType
#define UNARY_OP_TEST(FIXTURENAME, TESTNAME, OP)
atan(expr.val())
expr val()
void TearDown() override
tanh(expr.val())
#define BINARY_OP_TEST(FIXTURENAME, TESTNAME, OP)
expr expr1 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 c *expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr2 expr1 expr2 expr1 expr1 expr1 c
#define UNARY_ASSIGNOP_TEST(FIXTURENAME, TESTNAME, OP)
SimpleFad< ValueT > min(const SimpleFad< ValueT > &a, const SimpleFad< ValueT > &b)
Sacado::Random< ScalarType > urand
sqrt(expr.val())
sinh(expr.val())
tan(expr.val())
#define BINARY_FUNC_TEST(FIXTURENAME, TESTNAME, FUNC)
ScalarType tol_r
Sacado::ScalarType< FadType >::type ScalarType
#define UNARY_FUNC_TEST(FIXTURENAME, TESTNAME, FUNC)
ScalarT composite1(const ScalarT &a, const ScalarT &b)
void SetUp() override
sin(expr.val())
TYPED_TEST_SUITE_P(FadBLASUnitTests)
log(expr.val())
FAD::Fad< ScalarType > a_fad_
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)
A random number generator that generates random numbers uniformly distributed in the interval (a...
exp(expr.val())
fabs(expr.val())
#define COMPARE_FADS(a, b)
Definition: GTestUtils.hpp:92
FAD::Fad< ScalarType > b_fad_
ScalarType tol_a
int n
log10(expr.val())
#define RELOP_TEST(FIXTURENAME, TESTNAME, OP)
cos(expr.val())
Base template specification for testing whether type is statically sized.