Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Macros | Functions
NestedFadUnitTests.hpp File Reference
#include "Sacado_No_Kokkos.hpp"
#include "Sacado_Random.hpp"
#include "Fad/fad.h"
#include <gtest/gtest.h>
#include "GTestUtils.hpp"
Include dependency graph for NestedFadUnitTests.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  FadFadOpsUnitTest< FadFadType >
 

Macros

#define BINARY_OP_TEST(FIXTURENAME, TESTNAME, OP)
 
#define RELOP_TEST(FIXTURENAME, TESTNAME, OP)
 
#define BINARY_FUNC_TEST(FIXTURENAME, TESTNAME, FUNC)
 
#define UNARY_OP_TEST(FIXTURENAME, TESTNAME, OP)
 
#define UNARY_FUNC_TEST(FIXTURENAME, TESTNAME, FUNC)
 
#define UNARY_ASSIGNOP_TEST(FIXTURENAME, TESTNAME, OP)
 

Functions

 TYPED_TEST_SUITE_P (FadFadOpsUnitTest)
 
 TYPED_TEST_P (FadFadOpsUnitTest, testMax)
 
 TYPED_TEST_P (FadFadOpsUnitTest, testMin)
 
 TYPED_TEST_P (FadFadOpsUnitTest, testComposite1)
 
 TYPED_TEST_P (FadFadOpsUnitTest, testPlusLR)
 
 TYPED_TEST_P (FadFadOpsUnitTest, testMinusLR)
 
 TYPED_TEST_P (FadFadOpsUnitTest, testTimesLR)
 
 TYPED_TEST_P (FadFadOpsUnitTest, testDivideLR)
 
 TYPED_TEST_P (FadFadOpsUnitTest, testPowConstB)
 
 REGISTER_TYPED_TEST_SUITE_P (FadFadOpsUnitTest, testAddition, testSubtraction, testMultiplication, testDivision, testEquals, testNotEquals, testLessThanOrEquals, testGreaterThanOrEquals, testLessThan, testGreaterThan, testPow, testUnaryPlus, testUnaryMinus, testExp, testLog, testLog10, testSqrt, testCos, testSin, testTan, testACos, testASin, testATan, testCosh, testSinh, testTanh, testAbs, testFAbs, testPlusEquals, testMinusEquals, testTimesEquals, testDivideEquals, testMax, testMin, testComposite1, testPlusLR, testMinusLR, testTimesLR, testDivideLR, testPowConstB)
 

Macro Definition Documentation

#define BINARY_OP_TEST (   FIXTURENAME,
  TESTNAME,
  OP 
)
Value:
TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
typedef decltype(this->a_dfad_) FadFadType; \
typedef typename Sacado::ValueType<FadFadType>::type FadType; \
auto a_dfad = this->a_dfad_; \
auto b_dfad = this->b_dfad_; \
auto c_dfad = this->c_dfad_; \
auto a_fad = this->a_fad_; \
auto b_fad = this->b_fad_; \
auto c_fad = this->c_fad_; \
c_dfad = a_dfad OP b_dfad; \
c_fad = a_fad OP b_fad; \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
\
double val = this->urand.number(); \
c_dfad = a_dfad OP val; \
c_fad = a_fad OP FadType(val); \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
\
c_dfad = val OP b_dfad; \
c_fad = FadType(val) OP b_fad; \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
}
TYPED_TEST_P(FadBLASUnitTests, testSCAL1)
#define COMPARE_NESTED_FADS(a, b)
Definition: GTestUtils.hpp:95
expr val()

Definition at line 134 of file NestedFadUnitTests.hpp.

#define RELOP_TEST (   FIXTURENAME,
  TESTNAME,
  OP 
)
Value:
TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
typedef decltype(this->a_dfad_) FadFadType; \
typedef typename Sacado::ValueType<FadFadType>::type FadType; \
auto a_dfad = this->a_dfad_; \
auto b_dfad = this->b_dfad_; \
auto a_fad = this->a_fad_; \
auto b_fad = this->b_fad_; \
bool r1 = a_dfad OP b_dfad; \
bool r2 = a_fad OP b_fad; \
ASSERT_TRUE(r1 == r2); \
\
double val = this->urand.number(); \
r1 = a_dfad OP val; \
r2 = a_fad OP FadType(val); \
ASSERT_TRUE(r1 == r2); \
\
r1 = val OP b_dfad; \
r2 = FadType(val) OP b_fad; \
ASSERT_TRUE(r1 == r2); \
}
TYPED_TEST_P(FadBLASUnitTests, testSCAL1)
expr val()
#define ASSERT_TRUE(condition)
Definition: gtest.h:1985

Definition at line 158 of file NestedFadUnitTests.hpp.

#define BINARY_FUNC_TEST (   FIXTURENAME,
  TESTNAME,
  FUNC 
)
Value:
TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
typedef decltype(this->a_dfad_) FadFadType; \
typedef typename Sacado::ValueType<FadFadType>::type FadType; \
auto a_dfad = this->a_dfad_; \
auto b_dfad = this->b_dfad_; \
auto c_dfad = this->c_dfad_; \
auto a_fad = this->a_fad_; \
auto b_fad = this->b_fad_; \
auto c_fad = this->c_fad_; \
c_dfad = FUNC (a_dfad,b_dfad); \
c_fad = FUNC (a_fad,b_fad); \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
\
double val = this->urand.number(); \
c_dfad = FUNC (a_dfad,val); \
c_fad = FUNC (a_fad,FadType(val)); \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
\
c_dfad = FUNC (val,b_dfad); \
c_fad = FUNC (FadType(val),b_fad); \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
}
TYPED_TEST_P(FadBLASUnitTests, testSCAL1)
#define COMPARE_NESTED_FADS(a, b)
Definition: GTestUtils.hpp:95
expr val()

Definition at line 180 of file NestedFadUnitTests.hpp.

#define UNARY_OP_TEST (   FIXTURENAME,
  TESTNAME,
  OP 
)
Value:
TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
auto a_dfad = this->a_dfad_; \
auto c_dfad = this->c_dfad_; \
auto a_fad = this->a_fad_; \
auto c_fad = this->c_fad_; \
c_dfad = OP a_dfad; \
c_fad = OP a_fad; \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
}
TYPED_TEST_P(FadBLASUnitTests, testSCAL1)
#define COMPARE_NESTED_FADS(a, b)
Definition: GTestUtils.hpp:95

Definition at line 204 of file NestedFadUnitTests.hpp.

#define UNARY_FUNC_TEST (   FIXTURENAME,
  TESTNAME,
  FUNC 
)
Value:
TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
auto a_dfad = this->a_dfad_; \
auto c_dfad = this->c_dfad_; \
auto a_fad = this->a_fad_; \
auto c_fad = this->c_fad_; \
c_dfad = FUNC (a_dfad); \
c_fad = FUNC (a_fad); \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
}
TYPED_TEST_P(FadBLASUnitTests, testSCAL1)
#define COMPARE_NESTED_FADS(a, b)
Definition: GTestUtils.hpp:95

Definition at line 215 of file NestedFadUnitTests.hpp.

#define UNARY_ASSIGNOP_TEST (   FIXTURENAME,
  TESTNAME,
  OP 
)
Value:
TYPED_TEST_P(FIXTURENAME, TESTNAME){ \
auto a_dfad = this->a_dfad_; \
auto b_dfad = this->b_dfad_; \
auto c_dfad = this->c_dfad_; \
auto a_fad = this->a_fad_; \
auto b_fad = this->b_fad_; \
auto c_fad = this->c_fad_; \
c_dfad = b_dfad; \
c_fad = b_fad; \
c_dfad OP a_dfad; \
c_fad OP a_fad; \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
\
double val = this->urand.number(); \
c_dfad OP val; \
c_fad OP val; \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
}
TYPED_TEST_P(FadBLASUnitTests, testSCAL1)
#define COMPARE_NESTED_FADS(a, b)
Definition: GTestUtils.hpp:95
expr val()

Definition at line 226 of file NestedFadUnitTests.hpp.

Function Documentation

TYPED_TEST_SUITE_P ( FadFadOpsUnitTest  )
TYPED_TEST_P ( FadFadOpsUnitTest  ,
testMax   
)

Definition at line 284 of file NestedFadUnitTests.hpp.

TYPED_TEST_P ( FadFadOpsUnitTest  ,
testMin   
)

Definition at line 357 of file NestedFadUnitTests.hpp.

TYPED_TEST_P ( FadFadOpsUnitTest  ,
testComposite1   
)

Definition at line 416 of file NestedFadUnitTests.hpp.

TYPED_TEST_P ( FadFadOpsUnitTest  ,
testPlusLR   
)

Definition at line 429 of file NestedFadUnitTests.hpp.

TYPED_TEST_P ( FadFadOpsUnitTest  ,
testMinusLR   
)

Definition at line 447 of file NestedFadUnitTests.hpp.

TYPED_TEST_P ( FadFadOpsUnitTest  ,
testTimesLR   
)

Definition at line 465 of file NestedFadUnitTests.hpp.

TYPED_TEST_P ( FadFadOpsUnitTest  ,
testDivideLR   
)

Definition at line 483 of file NestedFadUnitTests.hpp.

TYPED_TEST_P ( FadFadOpsUnitTest  ,
testPowConstB   
)

Definition at line 502 of file NestedFadUnitTests.hpp.

REGISTER_TYPED_TEST_SUITE_P ( FadFadOpsUnitTest  ,
testAddition  ,
testSubtraction  ,
testMultiplication  ,
testDivision  ,
testEquals  ,
testNotEquals  ,
testLessThanOrEquals  ,
testGreaterThanOrEquals  ,
testLessThan  ,
testGreaterThan  ,
testPow  ,
testUnaryPlus  ,
testUnaryMinus  ,
testExp  ,
testLog  ,
testLog10  ,
testSqrt  ,
testCos  ,
testSin  ,
testTan  ,
testACos  ,
testASin  ,
testATan  ,
testCosh  ,
testSinh  ,
testTanh  ,
testAbs  ,
testFAbs  ,
testPlusEquals  ,
testMinusEquals  ,
testTimesEquals  ,
testDivideEquals  ,
testMax  ,
testMin  ,
testComposite1  ,
testPlusLR  ,
testMinusLR  ,
testTimesLR  ,
testDivideLR  ,
testPowConstB   
)