$\newcommand{\W}[1]{ \; #1 \; } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\B}[1]{ {\bf #1} } \newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} } \newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} } \newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} } \newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }$

Specifications

Implementation
// suppress conversion warnings before other includes
//
# include <algorithm>
# include <cassert>

// list of possible options
# include <map>
extern std::map<std::string, bool> global_option;

// define fabs for use by ode_evaluate
{     return std::max(-x, x); }
}

size_t                     size       ,
size_t                     repeat     ,
)
{
// speed test global option values
if( global_option["atomic"] )
return false;
if( global_option["memory"] || global_option["onetape"] || global_option["optimize"] )
return false;
// -------------------------------------------------------------
// setup
assert( x.size() == size );
assert( jacobian.size() == size * size );

size_t i, j;
size_t p = 0;          // use ode to calculate function values
size_t n = size;       // number of independent variables
size_t m = n;          // number of dependent variables
ADVector X(n), Y(m);   // independent and dependent variables

// -------------------------------------------------------------
while(repeat--)
{     // choose next x value
for(j = 0; j < n; j++)
{     // set value of x[j]
X[j] = x[j];
// set up for X as the independent variable vector
X[j].diff(j, n);
}

// evaluate function