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

Fetch the next operator during a reverse sweep.

Use start_reverse to initialize to reverse play back. The first call to next_reverse (after start_reverse) will give the last operator in the recording.

Parameters:
opThe input value of op does not matter. Its output value is the next operator in the recording (in reverse order). The last operator sets op equal to EndOp.
op_argThe input value of *op_arg does not matter. 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, next_reverse does not check for the special case of op == CSumOp. In this case, the other return values from next_reverse must be corrected by a call to reverse_csum.
op_indexThe input value of op_index does not matter. Its output value is the index of this operator in the recording. Thus the output value following the previous call to start_reverse is equal to the number of variables in the recording minus one. In addition, the output value decreases by one with each call to next_reverse. The last operator sets op_index equal to 0.
var_indexThe input value of var_index does not matter. 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 673 of file player.hpp.

Referenced by optimize(), ReverseSweep(), RevHesSweep(), and RevJacSweep().