![]() |
Prev | Next | FunConstruct |
ADFun<Base> f
ADFun<Base> f(x, y)
AD<Base>
object
f
can
store an AD of
Base
operation sequence
.
It can then be used to calculate derivatives of the corresponding
AD function
\[
F : B^n \rightarrow B^m
\]
where
B
is the space corresponding to objects of type
Base
.
x
is present, it has prototype
const VectorAD &x
It must be the vector argument in the previous call to
Independent
.
Neither its size, or any of its values, are allowed to change
between calling
Independent(x)
and
ADFun<Base> f(x, y)
.
y
is present, it has prototype
const VectorAD &y
The sequence of operations that map
x
to
y
are stored in the AD function object
f
.
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.
ADFun<Base> f
creates an
AD<Base>
object with no corresponding operation sequence; i.e.,
f.size_var()
returns the value zero (see size_var
).
ADFun<Base> f(x, y)
creates the
AD<Base>
object
f
,
stops the recording of AD of
Base
operations
corresponding to the call
Independent(x)
and stores the corresponding operation sequence in the object
f
.
It then stores the first order taylor_ coefficients
(corresponding to the value of
x
) in
f
.
This is equivalent to the following steps using the default constructor:
f
with the default constructor
ADFun<Base> f;
f.Dependent(x, y);
(see Dependent
).
f.Forward(p, x_p)
with
p
equal to zero and the elements of
x_p
equal to the corresponding elements of
x
(see Forward
).
Independent
and the corresponding call to
ADFun<Base> f( x, y)
or
f.Dependent( x, y)
must be preformed by the same thread.