|
| ADTest (const std::string &_func, double _min, double _max, double _dx=1e-6, double _reltol=1e-5, int _steps=20, double _abstol=1e-10) |
|
bool | run () |
|
Definition at line 18 of file autodiff.C.
◆ ADTest()
FParserAutodiffTest::ADTest::ADTest |
( |
const std::string & |
_func, |
|
|
double |
_min, |
|
|
double |
_max, |
|
|
double |
_dx = 1e-6 , |
|
|
double |
_reltol = 1e-5 , |
|
|
int |
_steps = 20 , |
|
|
double |
_abstol = 1e-10 |
|
) |
| |
|
inline |
Definition at line 20 of file autodiff.C.
References dF, dFaopt, dFopt, F, and func.
31 CPPUNIT_ASSERT_MESSAGE (
"Failed to parse test function",
F.Parse(
func,
"x") == -1);
36 CPPUNIT_ASSERT_MESSAGE (
"Failed to take derivative of function",
dF.AutoDiff(
"x") == -1);
39 CPPUNIT_ASSERT_MESSAGE (
"Failed to take derivative of optimized function",
dFopt.AutoDiff(
"x") == -1);
41 dFaopt.SetADFlags(FunctionParserAD::ADAutoOptimize,
true);
42 CPPUNIT_ASSERT_MESSAGE (
"Failed to take derivative of auto-optimized function",
dFaopt.AutoDiff(
"x") == -1);
◆ run()
bool FParserAutodiffTest::ADTest::run |
( |
| ) |
|
|
inline |
Definition at line 45 of file autodiff.C.
References std::abs(), abstol, dF, dFaopt, dFopt, dx, F, func, max, min, reltol, and steps.
47 double x1, x2, vdF, vF1, vF2, fd;
62 std::cout <<
"Error in " <<
func <<
": " << fd <<
"!=" << vdF <<
" at x=" << x <<
'\n';
69 std::cout <<
"Error in opt " <<
func <<
": " << fd <<
"!=" << vdF <<
" at x=" << x <<
'\n';
76 std::cout <<
"Error in auto opt " <<
func <<
": " << fd <<
"!=" << vdF <<
" at x=" << x <<
'\n';
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
◆ abstol
double FParserAutodiffTest::ADTest::abstol |
|
private |
◆ dF
FunctionParserAD FParserAutodiffTest::ADTest::dF |
|
private |
◆ dFaopt
FunctionParserAD FParserAutodiffTest::ADTest::dFaopt |
|
private |
◆ dFopt
FunctionParserAD FParserAutodiffTest::ADTest::dFopt |
|
private |
◆ dx
double FParserAutodiffTest::ADTest::dx |
|
private |
FunctionParserAD FParserAutodiffTest::ADTest::F |
|
private |
◆ func
std::string FParserAutodiffTest::ADTest::func |
|
private |
◆ max
double FParserAutodiffTest::ADTest::max |
|
private |
◆ min
double FParserAutodiffTest::ADTest::min |
|
private |
◆ reltol
double FParserAutodiffTest::ADTest::reltol |
|
private |
◆ steps
int FParserAutodiffTest::ADTest::steps |
|
private |
The documentation for this class was generated from the following file: