Prev Next ForwardSweep

Forward Computation of Taylor Coefficients

Syntax
size_t ForwardSweep(
     bool 
print,
     size_t 
d,
     size_t 
numvar,
     TapeRec<
Base> *Rec,
     size_t 
J,
     Base *
Taylor,
)


Return Value
The return value is equal to the number of AD<Base> comparison operations have a different result from when the information in Rec was recorded.

Rec
The information stored in Rec is a recording of the operations corresponding to a function  \[
     F : B^n \rightarrow B^m
\] 


print
If print is false, suppress the output that is otherwise generated by the PripOp and PrivOp instructions.

d
Given the d-1-th order Taylor coefficients matrix for all the variables, and the d-th order Taylor coefficients for all the independent variables, ForwardSweep computes the d-th order Taylor coefficients for all the other variables.

numvar
is the number of rows in the matrix Taylor. It must also be equal to Rec->TotNumVar().

J
Is the number of columns in the coefficient matrix Taylor. This must be greater than or equal  d+1 .

On Input

Independent Variables and Operators
The independent variable records come first. For  i = 1, \ldots , n and  j = 0 , \ldots , d ,
field Value
Taylor[0 * J + j] the variable with index zero is not used
Rec->GetOp(0) the operator with index zero must be a NonOp
Taylor[i * J + j] j-th order coefficient for variable with index i
Rec->GetOp(i) the operator with index i must be a InvOp

Other Variables and Operators
The other variables follow the independent variables. For  i = n+1, \ldots , numvar-1 ,  j = 0 , \ldots , d-1 , and  k = n+1, \ldots , Rec->NumOp() - 1,
field Value
Taylor[i * J + j] j-th coefficient for variable with index i
Rec->GetOp(i) any operator except for InvOp

On Output

Rec
None of the values stored in Rec are modified.

Independent Variables
For  i = 1, \ldots , n and  j = 0 , \ldots , J-1 , Taylor[i * J + j] is not modified.

Other Variables
For  i = n+1, \ldots , numvar-1 and  j < d , Taylor[i * J + j] is not modified. For  i = n+1, \ldots , numvar-1 , Taylor[i * J + d] is set equal to the d-th order Taylor coefficient for the variable with index i.
Input File: cppad/local/forward_sweep.hpp