\(\newcommand{\W}[1]{ \; #1 \; }\) \(\newcommand{\R}[1]{ {\rm #1} }\) \(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} }\) \(\newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} }\) \(\newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} }\) \(\newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }\)
forward_zero¶
View page sourceZero Order Forward Mode: Function Values¶
Syntax¶
Forward
(0, x0 )Forward
(0, x0 , s )Purpose¶
We use \(F : \B{R}^n \rightarrow \B{R}^m\) to denote the AD Function corresponding to f . The result of the syntax above is
See the FunCheck discussion for possible differences between \(F(x)\) and the algorithm that defined the operation sequence.
f¶
The object f has prototype
ADFun
< Base > f
Note that the ADFun object f is not const
.
After this call to Forward
, the value returned by
f .
size_order
()
will be equal to one (see size_order ).
x0¶
The argument x0 has prototype
const
Vector & x0
(see Vector below) and its size must be equal to n , the dimension of the Domain space for f .
s¶
If the argument s is not present, std::cout
is used in its place.
Otherwise, this argument has prototype
std::ostream&
s
It specifies where the output corresponding to PrintFor , and this zero order forward mode call, will be written.
y0¶
The result y0 has prototype
Vector y0
(see Vector below) and its value is \(F(x)\) at x = x0 . The size of y0 is equal to m , the dimension of the Range space for f .
Vector¶
The type 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.
Example¶
The file forward.cpp contains an example and test of this operation.
Special Case¶
This is special case of forward_order where
and \(o( t^q ) * t^{-q} \rightarrow 0\) as \(t \rightarrow 0\). For this special case, \(q = 0\), \(x^{(0)}\) = x0 , \(X(t) = x^{(0)}\), and
which agrees with the specifications for y0 in the Purpose above.