![]() |
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.
Independent(
x)
and
ADFun<
Base>
f(
x,
y)
.
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:
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.