Prev | Next |
Independent(x)
Independent(x, dynamic)
Independent(x, abort_op_index)
Independent(x, abort_op_index, record_compare)
Independent(x, abort_op_index, record_compare, dynamic)
x
as the independent variable vector.
Once the
operation sequence
is completed,
it must be transferred to a function object or aborted; see below.
f
,
using either the function constructor
ADFun<Base> f(x, y)
or the dependent variable specifier
f.Dependent(x, y)
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.
x
has prototype
ADVector &x
(see
ADVector
below).
The size of the vector
x
, must be greater than zero,
and is the number of independent variables for this
AD operation sequence.
size_t abort_op_index
If it is present,
it specifies the operator index at which the execution will 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
for
op_index
and NDEBUG
.
No abort will occur if
abort_op_index
is zero.
If this argument is not present, the default value zero is used
for
abort_index
.
bool record_compare
If it is present,
it specifies if AD compare
operations are recorded.
It takes extra time and memory to record these operations.
On the other hand, they can be useful for detecting when and why
a functions recording would change; see
abort_op_index
above and
compare_change
.
If this argument is not present, the default value true
is used
for
record_compare
.
If this argument is false,
abort_op_index
must be zero.
const ADVector& dynamic
(see
Vector
below).
It specifies the independent
dynamic
parameters.
The value of these parameters,
in the ADFun
object
f
,
that can be changed using new_dynamic
.
dynamic
,
and do not depend on
x
.
It is more efficient to compute other dynamic parameters before calling
Independent
and include them in the
independent dynamic parameter vector
dynamic
.
ADVector
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.
Independent
starts the recording for the current thread.
The recording must be stopped by a corresponding call to
ADFun<Base> f( x, y)
or
f.Dependent( x, y)
or abort_recording
preformed by the same thread; i.e.,
thread_alloc::thread_num
must be the same.