Prev | Next |
dw = f.Reverse(2, w)
f
.
Reverse mode computes the derivative of the Forward
mode
Taylor coefficients
with respect to the domain variable
.
x_k
in the previous call (counting this call) of the form
f.Forward(k, x_k)
If there is no previous call with
,
is the value of the independent variables when the
corresponding
AD of
Base
operation sequence
was recorded.
f
has prototype
const ADFun<Base> f
Before this call to Reverse
, the value returned by
f.size_order()
must be greater than or equal two (see size_order
).
w
has prototype
const Vector &w
(see Vector
below)
and its size
must be equal to
m
, the dimension of the
range
space for
f
.
dw
has prototype
Vector dw
(see Vector
below).
It contains both the derivative
and the derivative
.
The size of
dw
is equal to
,
where
is the dimension of the
domain
space for
f
.
dw
contains the same values as are returned
by reverse_one
.
Vector
must be a SimpleVector
class with
elements of type
Base
.
The routine CheckSimpleVector
will generate an error message
if this is not the case.
i
-th elementary vector.
It follows that for
Thus the vector
is equal to the Hessian of
times the direction
.
In the special case where
is the l
-th
elementary vector
,