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_subvv_op ( size_t  d,
size_t  i_z,
const addr_t *  arg,
const Base *  parameter,
size_t  cap_order,
const Base *  taylor,
size_t  nc_partial,
Base *  partial 
)
inline

Compute reverse mode partial derivatives for result of op = SubvvOp.

The C++ source code corresponding to this operation is

     z = x - y

In the documentation below, this operations is for the case where both x and y are variables and the argument parameter is not used.

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

     H( y , x , w , u , ... ) = G[ z(x , y) , 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
dhighest order Taylor coefficient that we are computing the partial derivatives with respect to.
i_zvariable index corresponding to the result for this operation; i.e. the row index in taylor corresponding to z.
argarg[0] index corresponding to the left operand for this operator; i.e. the index corresponding to x.
arg[1] index corresponding to the right operand for this operator; i.e. the index corresponding to y.
parameterIf x is a parameter, parameter [ arg[0] ] is the value corresponding to x.
If y is a parameter, parameter [ arg[1] ] is the value corresponding to y.
cap_ordermaximum number of orders that will fit in the taylor array.
taylortaylor [ i_z * cap_order + k ] for k = 0 , ... , d is the k-th order Taylor coefficient corresponding to z.
If x is a variable, taylor [ arg[0] * cap_order + k ] for k = 0 , ... , d is the k-th order Taylor coefficient corresponding to x.
If y is a variable, taylor [ arg[1] * cap_order + k ] for k = 0 , ... , d is the k-th order Taylor coefficient corresponding to y.
nc_partialnumber of colums in the matrix containing all the partial derivatives.
partialInput: partial [ i_z * nc_partial + k ] for k = 0 , ... , d is the partial derivative of G( z , y , x , w , u , ... ) with respect to the k-th order Taylor coefficient for z.
Input: If x is a variable, partial [ arg[0] * nc_partial + k ] for k = 0 , ... , d is the partial derivative of G( z , y , x , w , u , ... ) with respect to the k-th order Taylor coefficient for x.
Input: If y is a variable, partial [ arg[1] * nc_partial + k ] for k = 0 , ... , d is the partial derivative of G( z , x , w , u , ... ) with respect to the k-th order Taylor coefficient for the auxillary variable y.
Output: If x is a variable, partial [ arg[0] * nc_partial + k ] for k = 0 , ... , d is the partial derivative of H( y , x , w , u , ... ) with respect to the k-th order Taylor coefficient for x.
Output: If y is a variable, partial [ arg[1] * nc_partial + k ] for k = 0 , ... , d is the partial derivative of H( y , x , w , u , ... ) with respect to the k-th order Taylor coefficient for y.
Output: partial [ i_z * nc_partial + k ] for k = 0 , ... , d may be used as work space; i.e., may change in an unspecified manner.
Checked Assumptions
  • NumArg(op) == 2
  • NumRes(op) == 1
  • If x is a variable, arg[0] < i_z
  • If y is a variable, arg[1] < i_z
  • d < cap_order
  • d < nc_partial

Definition at line 151 of file sub_op.hpp.

Referenced by reverse_sweep().