uses the lower order Taylor coefficients and computes the p-th order Taylor coefficients for all the variables in the operation sequence corresponding to
y_p = f.Forward(p, x_p)
f. You can determine the number of variables in the operation sequence using the size_var function. The
capacity_tayloroperation allows you to control that amount of memory that is retained by an AD function object (to hold
Forwardresults for subsequent calculations).
It specifies the number of Taylor coefficients that are allocated for each variable in the AD operation sequence corresponding to
Forwardwith the maximum value of
q, it should be faster to pre-allocate memory for these calls using
q + 1. If you do no do this,
Forwardwill automatically allocate memory and will copy the results to a larger buffer, when necessary.
Note that each call to Dependent frees the old memory connected to the function object and sets the corresponding taylor capacity to zero.
qand higher (that are stored in
f), you can reduce the memory allocated to
q. Note that, if ta_hold_memory is true, this memory is not actually returned to the system, but rather held for future use by the same thread.
fis constructed with the syntax
, there is an implicit call to
ADFun<Base> f(x, y)
pequal to zero and
x_pequal to the value of the independent variables when the AD operation sequence was recorded.