CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
template<class Base >
void CppAD::local::reverse_load_op ( OpCode  op,
size_t  d,
size_t  i_z,
const addr_t *  arg,
size_t  cap_order,
const Base *  taylor,
size_t  nc_partial,
Base *  partial,
const addr_t *  var_by_load_op 
)
inline

Reverse mode for op = LdpOp or LdvOp.

The C++ source code corresponding to this operation is

     v[x] = y

where v is a VecAD<Base> vector, x is an AD<Base> object, and y is AD<Base> or Base objects. We define the index corresponding to v[x] by

     i_v_x = index_by_ind[ arg[0] + i_vec ]

where i_vec is defined under the heading arg[1] below:

This routine is given the partial derivatives of a function G(z , y[x] , w , u ... ) and it uses them to compute the partial derivatives of

     H( y[x] , w , u , ... ) = G[ z( y[x] ) , y[x] , w , u , ... ]
Template Parameters
Basebase type for the operator; i.e., this operation was recorded using AD< Base > and computations by this routine are done using type Base.
Parameters
opis the code corresponding to this operator; i.e., LdpOp or LdvOp (only used for error checking).
dhighest order the Taylor coefficient that we are computing the partial derivative with respect to.
i_zis the AD variable index corresponding to the variable z.
argarg[2] Is the index of this vecad load instruction in the var_by_load_op array.
cap_ordernumber of columns in the matrix containing the Taylor coefficients (not used).
taylormatrix of Taylor coefficients (not used).
nc_partialnumber of colums in the matrix containing all the partial derivatives (not used if arg[2] is zero).
partialIf arg[2] is zero, y[x] is a parameter and no values need to be modified; i.e., partial is not used. Otherwise, y[x] is a variable and:

partial [ i_z * nc_partial + k ] for k = 0 , ... , d is the partial derivative of G with respect to the k-th order Taylor coefficient for z.

If arg[2] is not zero, partial [ arg[2] * nc_partial + k ] for k = 0 , ... , d is the partial derivative with respect to the k-th order Taylor coefficient for x. On input, it corresponds to the function G, and on output it corresponds to the the function H.
var_by_load_opis a vector with size play->num_load_op_rec(). It contains the variable index corresponding to each load instruction. In the case where the index is zero, the instruction corresponds to a parameter (not variable).
Checked Assertions
  • NumArg(op) == 3
  • NumRes(op) == 1
  • d < cap_order
  • size_t(arg[2]) < i_z

Definition at line 547 of file load_op.hpp.

Referenced by reverse_sweep().