CppAD: A C++ Algorithmic Differentiation Package  20130918
template<class Base>
void CppAD::player< Base >::reverse_next ( OpCode op,
const addr_t *&  op_arg,
size_t &  op_index,
size_t &  var_index 
) [inline]

Fetch the next operator during a reverse sweep.

Use reverse_start to initialize to reverse play back. The first call to reverse_next (after reverse_start) will give the last operator in the recording. We use the notation reverse_routine to denote the set reverse_start, reverse_next, reverse_csum, reverse_cskip.

Parameters:
op[in,out] The input value of op must be its output value from the previous call to a reverse_routine. Its output value is the next operator in the recording (in reverse order). The last operator sets op equal to EndOp.
op_arg[in,out] The input value of op_arg must be its output value from the previous call to a reverse_routine. Its output value is the beginning of the vector of argument indices for this operation. The last operator sets op_arg equal to the beginning of the argument indices for the entire recording. For speed, reverse_next does not check for the special cases op == CSumOp or op == CSkipOp. In these cases, the other return values from reverse_next must be corrected by a call to reverse_csum or reverse_cskip respectively.
op_index[in,out] The input value of op_index must be its output value from the previous call to a reverse_routine. Its output value is the index of this operator in the recording. Thus the output value following the previous call to reverse_start is equal to the number of variables in the recording minus one. In addition, the output value decreases by one with each call to reverse_next. The last operator sets op_index equal to 0.
var_index[in,out] The input value of var_index must be its output value from the previous call to a reverse_routine. Its output value is the index of the primary (last) result corresponding to the operator op. The last operator sets var_index equal to 0 (corresponding to BeginOp at beginning of operation sequence).

Definition at line 562 of file player.hpp.

Referenced by CppAD::optimize::optimize_run(), CppAD::ReverseSweep(), CppAD::RevHesSweep(), and CppAD::RevJacSweep().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines