![]() |
Prev | Next |
y_p = f.forward(p, x_p)
adfun
object f
.
Given the p
-th order Taylor expansion for a function
@(@
X : \B{R} \rightarrow \B{R}^n
@)@, this function can be used
to compute the p
-th order Taylor expansion for the function
@(@
Y : \B{R} \rightarrow \B{R}^m
@)@ defined by
@[@
Y(t) = F [ X(t) ]
@]@
x_k
in the
most recent call to
f.forward(k, x_k)
including @(@
x^{(p)}
@)@ as the value
x_p
in this call.
We define the function @(@
X(t)
@)@ by
@[@
X(t) = x^{(0)} + x^{(1)} * t + \cdots + x^{(p)} * t^p
@]@
y_p
returned by this call.
f
must be an adfun
object.
We use level
for the AD ad
level of
this object.
p
is a non-negative int
.
It specifies the order of the Taylor coefficient for @(@
Y(t)
@)@
that is computed.
x_p
is a numpy.array
with one dimension
(i.e., a vector) with length equal to the domain size n
for the function
f
.
It specifies the p
-th order Taylor coefficient for @(@
X(t)
@)@.
If the AD level
for
f
is zero,
all the elements of
x_p
must be either int
or instances
of float
.
If the AD level
for
f
is one,
all the elements of
x_p
must be a_float
objects.
y_p
is a numpy.array
with one dimension
(i.e., a vector) with length equal to the range size m
for the function
f
.
It is set to the p
-th order Taylor coefficient for @(@
Y(t)
@)@.
If the AD level
for
f
is zero,
all the elements of
y_p
will be instances of float
.
If the AD level
for
f
is one,
all the elements of
y_p
will be a_float
objects.
forward_0.py | Forward Order Zero: Example and Test |
forward_1.py | Forward Order One: Example and Test |