|
Prev | Next |
f
is an
ADFun<Base>
object,
the vectors returned by
f.Forward
,
and
f.Reverse
,
have values in the base type (
Base
) and not
AD<Base>
.
This reflects the fact that operations used to calculate
these function values are not recorded by the tape corresponding to
AD<Base>
operations.
f.Forward
might be used as part of
Taylor's method for solving ordinary
differential equations.
In addition, we might want to differentiate the
solution of a differential equation with respect to parameters
in the equation.
This can be accomplished in the following way:
AD< AD<double> >
.
AD<double>
class.
double class.
AD<double>
operations,
and
fin
is an
ADFun< AD<double> >
object,
the operations used to compute the vectors
returned by
fin.Forward
,
fin.Rev
,
and
fin.RevTwo
,
will be recorded on the tape corresponding to
AD<double>
operations.
Independent(x)
where
x
is
a SimpleVector
with elements of type
AD<double>
.
This will start recording a new tape of
operations performed using
AD<double>
class objects.
Independent(X)
where
X
is
a SimpleVector
with elements of type
CPPAD_TEST_VECTOR< AD< AD<double> > >
.
This will start recording a new tape of
operations performed using
AD< AD<double> >
class objects.
AD< AD<double> >
class objects.
ADFun< AD<double> >
function object
fin
.
This will also stop recording of
operations performed using
AD< AD<double> >
class objects.
The
fin
object can then be used to calculate
the derivatives needed to compute the outer function.
AD<double>
class objects.
ADFun<double>
function object
fout
.
This will also stop the recording of
operations performed using
AD<double>
class objects.
The
fout
object can then be used to calculate
the derivatives of the outer function.