CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
template<class Vector_set >
void CppAD::local::reverse_sparse_jacobian_unary_op ( size_t  i_z,
size_t  i_x,
Vector_set &  sparsity 
)
inline

Reverse mode Jacobian sparsity pattern for all unary operators.

The C++ source code corresponding to a unary operation has the form

     z = fun(x)

where fun is a C++ unary function, or it has the form

     z = x op q

where op is a C++ bianry operator and q is a parameter.

This routine is given the sparsity patterns for a function G(z, y, ... ) and it uses them to compute the sparsity patterns for

     H( x , w , u , ... ) = G[ z(x) , x , w , u , ... ]
Template Parameters
Vector_setis the type used for vectors of sets. It can be either sparse_pack or sparse_list.
Parameters
i_zvariable index corresponding to the result for this operation; i.e. the row index in sparsity corresponding to z.
i_xvariable index corresponding to the argument for this operator; i.e. the row index in sparsity corresponding to x.
sparsityInput: The set with index i_z in sparsity is the sparsity bit pattern for G with respect to the variable z.
Input: The set with index i_x in sparsity is the sparsity bit pattern for G with respect to the variable x.
Output: The set with index i_x in sparsity is the sparsity bit pattern for H with respect to the variable x.
Checked Assertions:
  • i_x < i_z

Definition at line 127 of file sparse_unary_op.hpp.

Referenced by rev_jac_sweep().