CppAD: A C++ Algorithmic Differentiation Package
20130102
|
void 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 p
where op is a C++ bianry operator and p 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 , ... ]
Vector_set | is the type used for vectors of sets. It can be either sparse_pack , sparse_set , or sparse_list . |
i_z | variable index corresponding to the result for this operation; i.e. the row index in sparsity corresponding to z. |
i_x | variable index corresponding to the argument for this operator; i.e. the row index in sparsity corresponding to x. |
sparsity | Input: 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. |
Definition at line 130 of file sparse_unary_op.hpp.
Referenced by RevJacSweep().