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
NestedFadUnitTests.hpp File Reference
#include "Sacado_No_Kokkos.hpp"
#include "Sacado_Random.hpp"
#include "Fad/fad.h"
#include <cppunit/extensions/HelperMacros.h>
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, ScalarType >
 

Macros

#define COMPARE_VALUES(a, b)   CPPUNIT_ASSERT( std::abs(a-b) < this->tol_a + this->tol_r*std::abs(a) );
 
#define COMPARE_FADS(a, b)
 
#define COMPARE_NESTED_FADS(a, b)
 
#define BINARY_OP_TEST(TESTNAME, OP)
 
#define RELOP_TEST(TESTNAME, OP)
 
#define BINARY_FUNC_TEST(TESTNAME, FUNC)
 
#define UNARY_OP_TEST(TESTNAME, OP)
 
#define UNARY_FUNC_TEST(TESTNAME, FUNC)
 
#define UNARY_ASSIGNOP_TEST(TESTNAME, OP)
 

Macro Definition Documentation

#define COMPARE_VALUES (   a,
 
)    CPPUNIT_ASSERT( std::abs(a-b) < this->tol_a + this->tol_r*std::abs(a) );

Definition at line 43 of file NestedFadUnitTests.hpp.

#define COMPARE_FADS (   a,
 
)
Value:
CPPUNIT_ASSERT(a.size() == b.size()); \
CPPUNIT_ASSERT(a.hasFastAccess() == b.hasFastAccess()); \
COMPARE_VALUES(a.val(), b.val()); \
for (int zz=0; zz<a.size(); zz++) { \
COMPARE_VALUES(a.dx(zz), b.dx(zz)); \
COMPARE_VALUES(a.fastAccessDx(zz), b.fastAccessDx(zz)); \
} \
;
#define COMPARE_VALUES(a, b)

Definition at line 46 of file NestedFadUnitTests.hpp.

#define COMPARE_NESTED_FADS (   a,
 
)
Value:
CPPUNIT_ASSERT(a.size() == b.size()); \
CPPUNIT_ASSERT(a.hasFastAccess() == b.hasFastAccess()); \
COMPARE_FADS(a.val(), b.val()); \
for (int z=0; z<a.size(); z++) { \
COMPARE_FADS(a.dx(z), b.dx(z)); \
COMPARE_FADS(a.fastAccessDx(z), b.fastAccessDx(z)); \
} \
;
#define COMPARE_FADS(a, b)

Definition at line 56 of file NestedFadUnitTests.hpp.

#define BINARY_OP_TEST (   TESTNAME,
  OP 
)
Value:
void TESTNAME () { \
c_dfad = a_dfad OP b_dfad; \
c_fad = a_fad OP b_fad; \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
\
double val = 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); \
}
Sacado::Fad::DFad< double > FadType
expr val()
#define COMPARE_NESTED_FADS(a, b)

Definition at line 66 of file NestedFadUnitTests.hpp.

#define RELOP_TEST (   TESTNAME,
  OP 
)
Value:
void TESTNAME () { \
bool r1 = a_dfad OP b_dfad; \
bool r2 = a_fad OP b_fad; \
CPPUNIT_ASSERT(r1 == r2); \
\
double val = urand.number(); \
r1 = a_dfad OP val; \
r2 = a_fad OP FadType(val); \
CPPUNIT_ASSERT(r1 == r2); \
\
r1 = val OP b_dfad; \
r2 = FadType(val) OP b_fad; \
CPPUNIT_ASSERT(r1 == r2); \
}
Sacado::Fad::DFad< double > FadType
expr val()

Definition at line 82 of file NestedFadUnitTests.hpp.

#define BINARY_FUNC_TEST (   TESTNAME,
  FUNC 
)
Value:
void TESTNAME () { \
c_dfad = FUNC (a_dfad,b_dfad); \
c_fad = FUNC (a_fad,b_fad); \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
\
double val = 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); \
}
Sacado::Fad::DFad< double > FadType
expr val()
#define COMPARE_NESTED_FADS(a, b)

Definition at line 98 of file NestedFadUnitTests.hpp.

#define UNARY_OP_TEST (   TESTNAME,
  OP 
)
Value:
void TESTNAME () { \
c_dfad = OP a_dfad; \
c_fad = OP a_fad; \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
}
#define COMPARE_NESTED_FADS(a, b)

Definition at line 114 of file NestedFadUnitTests.hpp.

#define UNARY_FUNC_TEST (   TESTNAME,
  FUNC 
)
Value:
void TESTNAME () { \
c_dfad = FUNC (a_dfad); \
c_fad = FUNC (a_fad); \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
}
#define COMPARE_NESTED_FADS(a, b)

Definition at line 121 of file NestedFadUnitTests.hpp.

#define UNARY_ASSIGNOP_TEST (   TESTNAME,
  OP 
)
Value:
void TESTNAME () { \
c_dfad OP a_dfad; \
c_fad OP a_fad; \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
\
double val = urand.number(); \
c_dfad OP val; \
c_fad OP FadType(val); \
COMPARE_NESTED_FADS(c_dfad, c_fad); \
}
Sacado::Fad::DFad< double > FadType
expr val()
#define COMPARE_NESTED_FADS(a, b)

Definition at line 128 of file NestedFadUnitTests.hpp.