Prev Next

@(@\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}} }@)@
Declare Independent Variables and Start Recording


Start recording AD of Base operations with x as the independent variable vector. Once the operation sequence is completed, it must be transferred to a function object; see below.

Start Recording
An operation sequence recording is started by the commands

Stop Recording
The recording is stopped, and the operation sequence is transferred to the AD function object f , using either the function constructor
or the dependent variable specifier
The only other way to stop a recording is using abort_recording . Between when the recording is started and when it stopped, we refer to the elements of x , and the values that depend on the elements of x , as AD<Base> variables.

The vector x has prototype
VectorAD &x
(see VectorAD below). The size of the vector x , must be greater than zero, and is the number of independent variables for this AD operation sequence.

It specifies the operator index at which the execution is be aborted by calling the CppAD error handler . When this error handler leads to an assert, the user can inspect the call stack to see the source code corresponding to this operator index; see purpose . No abort will occur if abort_op_index is zero, of if NDEBUG is defined.

The type VectorAD must be a SimpleVector class with elements of type AD<Base> . The routine CheckSimpleVector will generate an error message if this is not the case.

Parallel Mode
Each thread can have one, and only one, active recording. A call to Independent starts the recording for the current thread. The recording must be stopped by a corresponding call to
f.Dependent( xy)
or abort_recording preformed by the same thread; i.e., thread_alloc::thread_num must be the same.

The file independent.cpp contains an example and test of this operation. It returns true if it succeeds and false otherwise.
Input File: cppad/core/independent.hpp