CppAD: A C++ Algorithmic Differentiation Package
20130102
|
size_t forward0sweep | ( | std::ostream & | s_out, |
bool | print, | ||
size_t | n, | ||
size_t | numvar, | ||
player< Base > * | Rec, | ||
size_t | J, | ||
Base * | Taylor | ||
) |
Compute zero order forward mode Taylor coefficients.
Base | The type used during the forward mode computations; i.e., the corresponding recording of operations used the type AD<Base> . |
s_out | Is the stream where output corresponding to PriOp operations will be written. |
If print is false, suppress the output that is otherwise generated by the c PriOp instructions. | |
n | is the number of independent variables on the tape. |
numvar | is 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(). |
Rec | The information stored in Rec is a recording of the operations corresponding to the function
![]() ![]() 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. |
J | Is the number of columns in the coefficient matrix Taylor. This must be greater than or equal one. |
Taylor | Input: For j = 1 , ... , n, Taylor [ j * J + 0 ] variable with index i on the tape (independent variable with index (j-1) in the independent variable vector). Output: For i = n + 1, ... , numvar - 1, Taylor [ i * J + 0 ] is the zero order Taylor coefficient for the variable with index i on the tape. |
return 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 102 of file forward0sweep.hpp.
Referenced by ADFun< Base >::ADFun(), and ADFun< Base >::Forward().