Prev Next Index-> contents reference index search external Up-> CppAD ADFun FunEval Forward ForwardZero ADFun-> Independent FunConstruct Dependent abort_recording seq_property FunEval Drivers FunCheck optimize check_for_nan FunEval-> Forward Reverse Sparse Forward-> ForwardZero ForwardOne ForwardAny size_taylor CompareChange capacity_taylor number_skip forward.cpp forward_mul.cpp ForwardZero Headings-> Syntax Purpose f x s y Vector Example

Zero Order Forward Mode: Function Values

Syntax
y = f.Forward(0, x)
y = f.Forward(x, xs)

Purpose
We use  F : B^n \rightarrow B^m to denote the AD function corresponding to f . The result of the syntax above is  $y = F(x)$
(See the FunCheck discussion for possible differences between  F(x) and the algorithm that defined the operation sequence.)

f
The object f has prototype
Basef
Note that the ADFun object f is not const. After this call to Forward, the value returned by

f.size_taylor()
will be equal to one (see size_taylor ).

x
The argument x has prototype
const
Vectorx
(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.

y
The result y has prototype

Vector y
(see Vector below) and its value is  F(x) . The size of y 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.
Input File: omh/forward.omh