CppAD: A C++ Algorithmic Differentiation Package  20130918
template<class Base >
struct_size_pair CppAD::optimize::record_pv ( const CppAD::vector< struct struct_old_variable > &  tape,
size_t  current,
size_t  npar,
const Base *  par,
recorder< Base > *  rec,
OpCode  op,
const addr_t *  arg 
)

Record an operation of the form (parameter op variable).

Parameters:
tapeis a vector that maps a variable index, in the old operation sequence, to an struct_old_variable information record. Note that the index for this vector must be greater than or equal zero and less than tape.size().
  • tape[i].op is the operator in the old operation sequence corresponding to the old variable index i. Assertion: NumRes(tape[i].op) > 0.
  • tape[i].arg for j < NumArg( tape[i].op ), tape[i].arg[j] is the j-th the argument, in the old operation sequence, corresponding to the old variable index i. Assertion: tape[i].arg[j] < i.
  • tape[i].new_var Suppose i <= current, j < NumArg( tape[i].op ), and k = tape[i].arg[j], and j corresponds to a variable for operator tape[i].op. It follows that tape[k].new_var has alread been set to the variable in the new operation sequence corresponding to the old variable index k. This means that the new_var value has been set for all the possible arguments that come before current.
Parameters:
currentis the index in the old operation sequence for the variable corresponding to the result for the current operator. Assertions: current < tape.size(), NumRes( tape[current].op ) > 0.
nparis the number of parameters corresponding to this operation sequence.
paris a vector of length npar containing the parameters for this operation sequence; i.e., given a parameter index i, the corresponding parameter value is par[i].
recis the object that will record the operations.
opis the operator that we are recording which must be one of the following: AddpvOp, DivpvOp, MulpvOp, PowvpOp, SubpvOp.
argis the vector of arguments for this operator.
Returns:
the result is the operaiton and variable index corresponding to the current operation in the new operation sequence.

Definition at line 777 of file optimize.hpp.

Referenced by optimize_run().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines