#include "adolc/adouble.h"
#include "adolc/interfaces.h"
#include "Sacado_No_Kokkos.hpp"
#include "Sacado_Random.hpp"
#include <cppunit/extensions/HelperMacros.h>
#include "Sacado_Tay_CacheTaylor.hpp"
Go to the source code of this file.
|
#define | COMPARE_DOUBLES(a, b) CPPUNIT_ASSERT( fabs(a-b) < tol_a + tol_r*fabs(a) ); |
|
#define | COMPARE_POLYS(x_dtay, x_adolc) |
|
#define | COMPARE_TAYS(x_dtay, y_dtay) |
|
#define | BINARY_OP2_TEST(TESTNAME, OP) |
|
#define | BINARY_OPRC_TEST(TESTNAME, OP) |
|
#define | BINARY_OPLC_TEST(TESTNAME, OP) |
|
#define | BINARY_OP_TEST(TESTNAME, OP) |
|
#define | CPPUNIT_BINARY_OP_TEST(TESTNAME) |
|
#define | RELOP_OP2_TEST(TESTNAME, OP) |
|
#define | RELOP_OPLC_TEST(TESTNAME, OP) |
|
#define | RELOP_OPRC_TEST(TESTNAME, OP) |
|
#define | RELOP_OP_TEST(TESTNAME, OP) |
|
#define | CPPUNIT_RELOP_OP_TEST(TESTNAME) |
|
#define | BINARY_FUNC2_TEST(TESTNAME, FUNC) |
|
#define | BINARY_FUNCRC_TEST(TESTNAME, FUNC) |
|
#define | BINARY_FUNCLC_TEST(TESTNAME, FUNC) |
|
#define | BINARY_FUNC_TEST(TESTNAME, FUNC) |
|
#define | CPPUNIT_BINARY_FUNC_TEST(TESTNAME) |
|
#define | UNARY_OP_TEST(TESTNAME, OP) |
|
#define | UNARY_FUNC_TEST(TESTNAME, FUNC) |
|
#define | UNARY_ASSIGNOP2_TEST(TESTNAME, OP) |
|
#define | UNARY_ASSIGNOPRC_TEST(TESTNAME, OP) |
|
#define | UNARY_ASSIGNOPLC_TEST(TESTNAME, OP) |
|
#define | UNARY_ASSIGNOP_TEST(TESTNAME, OP) |
|
#define | CPPUNIT_UNARY_ASSIGNOP_TEST(TESTNAME) |
|
|
adouble | max (const adouble &a, const adouble &b) |
|
adouble | max (const adouble &a, double v) |
|
adouble | max (double v, const adouble &b) |
|
adouble | min (const adouble &a, const adouble &b) |
|
adouble | min (const adouble &a, double v) |
|
adouble | min (double v, const adouble &b) |
|
#define COMPARE_DOUBLES |
( |
|
a, |
|
|
|
b |
|
) |
| CPPUNIT_ASSERT( fabs(a-b) < tol_a + tol_r*fabs(a) ); |
#define COMPARE_POLYS |
( |
|
x_dtay, |
|
|
|
x_adolc |
|
) |
| |
Value:CPPUNIT_ASSERT(x_dtay.degree() == d); \
for (
int i=0; i<=d; i++) {
\
} \
;
#define COMPARE_DOUBLES(a, b)
Definition at line 54 of file TayUnitTests.hpp.
#define COMPARE_TAYS |
( |
|
x_dtay, |
|
|
|
y_dtay |
|
) |
| |
Value:CPPUNIT_ASSERT(x_dtay.degree() == y_dtay.degree()); \
for (
int i=0; i<=x_dtay.degree(); i++) {
\
} \
;
#define COMPARE_DOUBLES(a, b)
Definition at line 61 of file TayUnitTests.hpp.
#define BINARY_OP2_TEST |
( |
|
TESTNAME, |
|
|
|
OP |
|
) |
| |
Value:void TESTNAME () { \
c_dtay = a_dtay OP b_dtay; \
trace_on(0); \
adouble aa, ab, ac; \
aa <<= X[0][0]; \
ab <<= X[1][0]; \
ac = aa OP ab; \
ac >>= Y[0][0]; \
trace_off(); \
forward(0,1,2,d,0,X,Y);
\
}
#define COMPARE_POLYS(x_dtay, x_adolc)
Definition at line 68 of file TayUnitTests.hpp.
#define BINARY_OPRC_TEST |
( |
|
TESTNAME, |
|
|
|
OP |
|
) |
| |
Value:void TESTNAME () { \
double
val = urand.number(); \
c_dtay = a_dtay OP
val; \
trace_on(0); \
adouble aa, ac; \
aa <<= X[0][0]; \
ac >>= Y[0][0]; \
trace_off(); \
forward(0,1,1,d,0,X,Y);
\
}
#define COMPARE_POLYS(x_dtay, x_adolc)
Definition at line 82 of file TayUnitTests.hpp.
#define BINARY_OPLC_TEST |
( |
|
TESTNAME, |
|
|
|
OP |
|
) |
| |
Value:void TESTNAME () { \
double
val = urand.number(); \
c_dtay = val OP a_dtay; \
trace_on(0); \
adouble aa, ac; \
aa <<= X[0][0]; \
ac = val OP aa; \
ac >>= Y[0][0]; \
trace_off(); \
forward(0,1,1,d,0,X,Y);
\
}
#define COMPARE_POLYS(x_dtay, x_adolc)
Definition at line 96 of file TayUnitTests.hpp.
#define BINARY_OP_TEST |
( |
|
TESTNAME, |
|
|
|
OP |
|
) |
| |
Value:
#define BINARY_OP2_TEST(TESTNAME, OP)
#define BINARY_OPRC_TEST(TESTNAME, OP)
#define BINARY_OPLC_TEST(TESTNAME, OP)
Definition at line 110 of file TayUnitTests.hpp.
#define CPPUNIT_BINARY_OP_TEST |
( |
|
TESTNAME | ) |
|
Value:CPPUNIT_TEST(TESTNAME); \
CPPUNIT_TEST(TESTNAME ## LeftConstant); \
CPPUNIT_TEST(TESTNAME ## RightConstant)
Definition at line 115 of file TayUnitTests.hpp.
#define RELOP_OP2_TEST |
( |
|
TESTNAME, |
|
|
|
OP |
|
) |
| |
Value:void TESTNAME () { \
bool r1 = a_dtay OP b_dtay; \
bool r2 = a_dtay.coeff(0) OP b_dtay.coeff(0); \
CPPUNIT_ASSERT(r1 == r2); \
}
Definition at line 120 of file TayUnitTests.hpp.
#define RELOP_OPLC_TEST |
( |
|
TESTNAME, |
|
|
|
OP |
|
) |
| |
Value:void TESTNAME () { \
double
val = urand.number(); \
bool r1 = val OP b_dtay; \
bool r2 = val OP b_dtay.coeff(0); \
CPPUNIT_ASSERT(r1 == r2); \
}
Definition at line 127 of file TayUnitTests.hpp.
#define RELOP_OPRC_TEST |
( |
|
TESTNAME, |
|
|
|
OP |
|
) |
| |
Value:void TESTNAME () { \
double
val = urand.number(); \
bool r1 = a_dtay OP
val; \
bool r2 = a_dtay.coeff(0) OP
val; \
CPPUNIT_ASSERT(r1 == r2); \
}
Definition at line 135 of file TayUnitTests.hpp.
#define RELOP_OP_TEST |
( |
|
TESTNAME, |
|
|
|
OP |
|
) |
| |
Value:
#define RELOP_OPRC_TEST(TESTNAME, OP)
#define RELOP_OPLC_TEST(TESTNAME, OP)
#define RELOP_OP2_TEST(TESTNAME, OP)
Definition at line 143 of file TayUnitTests.hpp.
#define CPPUNIT_RELOP_OP_TEST |
( |
|
TESTNAME | ) |
|
Value:CPPUNIT_TEST(TESTNAME); \
CPPUNIT_TEST(TESTNAME ## LeftConstant); \
CPPUNIT_TEST(TESTNAME ## RightConstant)
Definition at line 148 of file TayUnitTests.hpp.
#define BINARY_FUNC2_TEST |
( |
|
TESTNAME, |
|
|
|
FUNC |
|
) |
| |
Value:void TESTNAME () { \
c_dtay = FUNC (a_dtay, b_dtay); \
trace_on(0); \
adouble aa, ab, ac; \
aa <<= X[0][0]; \
ab <<= X[1][0]; \
ac = FUNC (aa, ab); \
ac >>= Y[0][0]; \
trace_off(); \
forward(0,1,2,d,0,X,Y);
\
}
#define COMPARE_POLYS(x_dtay, x_adolc)
Definition at line 153 of file TayUnitTests.hpp.
#define BINARY_FUNCRC_TEST |
( |
|
TESTNAME, |
|
|
|
FUNC |
|
) |
| |
Value:void TESTNAME () { \
double
val = urand.number(); \
c_dtay = FUNC (a_dtay, val); \
trace_on(0); \
adouble aa, ac; \
aa <<= X[0][0]; \
ac = FUNC (aa, val); \
ac >>= Y[0][0]; \
trace_off(); \
forward(0,1,1,d,0,X,Y);
\
}
#define COMPARE_POLYS(x_dtay, x_adolc)
Definition at line 167 of file TayUnitTests.hpp.
#define BINARY_FUNCLC_TEST |
( |
|
TESTNAME, |
|
|
|
FUNC |
|
) |
| |
Value:void TESTNAME () { \
double
val = urand.number(); \
c_dtay = FUNC (val, a_dtay); \
trace_on(0); \
adouble aa, ac; \
aa <<= X[0][0]; \
ac = FUNC (val, aa); \
ac >>= Y[0][0]; \
trace_off(); \
forward(0,1,1,d,0,X,Y);
\
}
#define COMPARE_POLYS(x_dtay, x_adolc)
Definition at line 181 of file TayUnitTests.hpp.
#define BINARY_FUNC_TEST |
( |
|
TESTNAME, |
|
|
|
FUNC |
|
) |
| |
Value:
#define BINARY_FUNC2_TEST(TESTNAME, FUNC)
#define BINARY_FUNCLC_TEST(TESTNAME, FUNC)
#define BINARY_FUNCRC_TEST(TESTNAME, FUNC)
Definition at line 195 of file TayUnitTests.hpp.
#define CPPUNIT_BINARY_FUNC_TEST |
( |
|
TESTNAME | ) |
|
Value:CPPUNIT_TEST(TESTNAME); \
CPPUNIT_TEST(TESTNAME ## LeftConstant); \
CPPUNIT_TEST(TESTNAME ## RightConstant)
Definition at line 200 of file TayUnitTests.hpp.
#define UNARY_OP_TEST |
( |
|
TESTNAME, |
|
|
|
OP |
|
) |
| |
Value:void TESTNAME () { \
c_dtay = OP a_dtay; \
trace_on(0); \
adouble aa, ac; \
aa <<= X[0][0]; \
ac = OP aa; \
ac >>= Y[0][0]; \
trace_off(); \
forward(0,1,1,d,0,X,Y);
\
}
#define COMPARE_POLYS(x_dtay, x_adolc)
Definition at line 205 of file TayUnitTests.hpp.
#define UNARY_FUNC_TEST |
( |
|
TESTNAME, |
|
|
|
FUNC |
|
) |
| |
Value:void TESTNAME () { \
c_dtay = FUNC (a_dtay); \
trace_on(0); \
adouble aa, ac; \
aa <<= X[0][0]; \
ac = FUNC (aa); \
ac >>= Y[0][0]; \
trace_off(); \
forward(0,1,1,d,0,X,Y);
\
}
#define COMPARE_POLYS(x_dtay, x_adolc)
Definition at line 218 of file TayUnitTests.hpp.
#define UNARY_ASSIGNOP2_TEST |
( |
|
TESTNAME, |
|
|
|
OP |
|
) |
| |
Value:void TESTNAME () { \
c_dtay = a_dtay; \
c_dtay OP b_dtay; \
trace_on(0); \
adouble aa, ab, ac; \
aa <<= X[0][0]; \
ab <<= X[1][0]; \
ac = aa; \
ac OP ab; \
ac >>= Y[0][0]; \
trace_off(); \
forward(0,1,2,d,0,X,Y);
\
}
#define COMPARE_POLYS(x_dtay, x_adolc)
Definition at line 231 of file TayUnitTests.hpp.
#define UNARY_ASSIGNOPRC_TEST |
( |
|
TESTNAME, |
|
|
|
OP |
|
) |
| |
Value:void TESTNAME () { \
double
val = urand.number(); \
c_dtay = a_dtay; \
trace_on(0); \
adouble aa, ac; \
aa <<= X[0][0]; \
ac = aa; \
ac >>= Y[0][0]; \
trace_off(); \
forward(0,1,1,d,0,X,Y);
\
}
#define COMPARE_POLYS(x_dtay, x_adolc)
Definition at line 247 of file TayUnitTests.hpp.
#define UNARY_ASSIGNOPLC_TEST |
( |
|
TESTNAME, |
|
|
|
OP |
|
) |
| |
Value:void TESTNAME () { \
double
val = urand.number(); \
c_dtay OP a_dtay; \
trace_on(0); \
adouble aa, ac; \
aa <<= X[0][0]; \
ac OP aa; \
ac >>= Y[0][0]; \
trace_off(); \
forward(0,1,1,d,0,X,Y);
\
}
#define COMPARE_POLYS(x_dtay, x_adolc)
Definition at line 263 of file TayUnitTests.hpp.
#define UNARY_ASSIGNOP_TEST |
( |
|
TESTNAME, |
|
|
|
OP |
|
) |
| |
Value:
#define UNARY_ASSIGNOPLC_TEST(TESTNAME, OP)
#define UNARY_ASSIGNOPRC_TEST(TESTNAME, OP)
#define UNARY_ASSIGNOP2_TEST(TESTNAME, OP)
Definition at line 279 of file TayUnitTests.hpp.
#define CPPUNIT_UNARY_ASSIGNOP_TEST |
( |
|
TESTNAME | ) |
|
Value:CPPUNIT_TEST(TESTNAME); \
CPPUNIT_TEST(TESTNAME ## LeftConstant); \
CPPUNIT_TEST(TESTNAME ## RightConstant)
Definition at line 284 of file TayUnitTests.hpp.
adouble max |
( |
const adouble & |
a, |
|
|
const adouble & |
b |
|
) |
| |
|
inline |
adouble max |
( |
const adouble & |
a, |
|
|
double |
v |
|
) |
| |
|
inline |
adouble max |
( |
double |
v, |
|
|
const adouble & |
b |
|
) |
| |
|
inline |
adouble min |
( |
const adouble & |
a, |
|
|
const adouble & |
b |
|
) |
| |
|
inline |
adouble min |
( |
const adouble & |
a, |
|
|
double |
v |
|
) |
| |
|
inline |
adouble min |
( |
double |
v, |
|
|
const adouble & |
b |
|
) |
| |
|
inline |