Zero Order Forward Mode: Function Values
Keywords: zero order forward mode: function values syntax purpose f x0 s y0 vector example special case

| Prev | Next |  |  |  |  |  | forward_zero |

Zero Order Forward Mode: Function Values
Syntax
`y0 = f.Forward(0, x0)
` `y0 = f.Forward(0, x0, s)`
Purpose
We use F : B n → B m to denote the AD function corresponding to `f` . The result of the syntax above is y 0 = F ( x 0 ) 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. It returns true if it succeeds and false otherwise.
Special Case
This is special case of forward_order where Y ( t ) = F [ X ( t ) ] X ( t ) = x ( 0 ) t 0 + x ( 1 ) * t 1 + ⋯ , + x ( q ) * t q + o ( t q ) Y ( t ) = y ( 0 ) t 0 + y ( 1 ) * t 1 + ⋯ , + y ( q ) * t q + o ( t q ) and o ( t q ) * t - q → 0 as t → 0 . For this special case, q = 0 , x ( 0 ) `= x0` , X ( t ) = x ( 0 ) , and y ( 0 ) = Y ( t ) = F [ X ( t ) ] = F ( x ( 0 ) ) which agrees with the specifications for `y0` in the purpose above.

Input File: omh/forward/forward_zero.omh