CppAD: A C++ Algorithmic Differentiation Package  20130102
template<class Base >
size_t forward_sweep ( std::ostream &  s_out,
bool  print,
size_t  d,
size_t  n,
size_t  numvar,
player< Base > *  Rec,
size_t  J,
Base *  Taylor 
)

Compute arbitrary order forward mode Taylor coefficients.

Template Parameters:
Basebase type for the operator; i.e., this operation sequence was recorded using AD< Base > and computations by this routine are done using type Base.
Parameters:
s_outIs the stream where output corresponding to PriOp operations will be written.
printIf print is false, suppress the output that is otherwise generated by the PriOp instructions (must be false when d is nonzero).
dis the order of the Taylor coefficients that are computed during this call.
nis the number of independent variables on the tape.
numvaris the total number of variables on the tape. This is also equal to the number of rows in the matrix Taylor; i.e., Rec->num_rec_var().
RecThe information stored in Rec is a recording of the operations corresponding to the function

\[ F : {\bf R}^n \rightarrow {\bf R}^m \]

where $ n $ is the number of independent variables and $ m $ is the number of dependent variables.

The object Rec is effectly constant. There are two exceptions to this. The first exception is that while palying back the tape the object Rec holds information about the current location with in the tape and this changes during palyback. The second exception is the fact that the zero order ( d = 0 ) versions of the VecAD operators LdpOp and LdvOp modify the corresponding op_arg values returned by player::next_forward and player::next_reverse; see the LdpOp and LdvOp operations.
JIs the number of columns in the coefficient matrix Taylor. This must be greater than or equal d + 1.
TaylorInput: For j = 1 , ... , n, and for k = 0 , ... , d, Taylor [ j * J + k ] is the k-th order Taylor coefficient corresponding to variable with index j on the tape (independent variable with index (j-1) in the independent variable vector).

Output: For i = n + 1, ... , numvar - 1, and for k = 0 , ... , d, Taylor [ i * J + k ] is the k-th order Taylor coefficient for the variable with index i on the tape.

return If d is not zero, the return value is zero. If d is zero, the return value is equal to the number of ComOp operations that have a different result from when the information in Rec was recorded. (Note that if NDEBUG is true, there are no ComOp operations in Rec and hence this return value is always zero.)

Definition at line 109 of file forward_sweep.hpp.

Referenced by ADFun< Base >::ADFun(), and ADFun< Base >::Forward().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines