CppAD: A C++ Algorithmic Differentiation Package  20130918
template<class Vector_set >
void CppAD::reverse_sparse_jacobian_store_op ( OpCode  op,
const addr_t *  arg,
size_t  num_combined,
const size_t *  combined,
Vector_set &  var_sparsity,
Vector_set &  vecad_sparsity 
) [inline]

Reverse mode sparsity operations for StpvOp and StvvOp.

This routine is given the sparsity patterns for G(v[x], y , w , u ... ) and it uses them to compute the sparsity patterns for

	H(y , w , u , ... ) = G[ v[x], y , w , u , ... ]

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 = combined[ arg[0] + i_vec ]

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

Template Parameters:
Vector_setis the type used for vectors of sets. It can be either sparse_pack, sparse_set, or sparse_list.
Parameters:
opis the code corresponding to this operator; i.e., StpvOp or StvvOp (only used for error checking).
arg
arg[0] is the offset corresponding to this VecAD vector in the combined array.

arg[2]
The set with index arg[2] in var_sparsity is the sparsity pattern corresponding to y. (Note that arg[2] > 0 because y is a variable.)
num_combinedis the total number of elements in the VecAD address array.
combinedcombined [ arg[0] - 1 ] is the index of the set in vecad_sparsity corresponding to the sparsity pattern for the vector v. We use the notation i_v below which is defined by
	i_v = combined[ \a arg[0] - 1 ]
var_sparsityThe set with index arg[2] in var_sparsity is the sparsity pattern for y. This is an input for forward mode operations. For reverse mode operations: The sparsity pattern for v is added to the spartisy pattern for y.
vecad_sparsityThe set with index i_v in vecad_sparsity is the sparsity pattern for v. This is an input for reverse mode operations. For forward mode operations, the sparsity pattern for y is added to the sparsity pattern for the vector v.
Checked Assertions
  • NumArg(op) == 3
  • NumRes(op) == 0
  • 0 < arg[0]
  • arg[0] < num_combined
  • arg[2] < var_sparsity.n_set()
  • i_v < vecad_sparsity.n_set()

Definition at line 436 of file store_op.hpp.

Referenced by RevJacSweep().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines