CppAD: A C++ Algorithmic Differentiation Package
20171217
|
|
inline |
Compute reverse Hessian sparsity patterns for op = CExpOp.
This routine is given the sparsity patterns for a function G(z, y, x, ... ) and it uses them to compute the sparsity patterns for
H( y, x, w , u , ... ) = G[ z(x,y) , y , x , w , u , ... ]
where y represents the combination of y_0, y_1, y_2, and y_3.
The C++ source code coresponding to this operation is
z = CondExpRel(y_0, y_1, y_2, y_3)
where Rel is one of the following: Lt, Le, Eq, Ge, Gt.
Vector_set | is the type used for vectors of sets. It can be either sparse_pack or sparse_list. |
i_z | is the AD variable index corresponding to the variable z. |
arg | arg[0] is static cast to size_t from the enum type enum CompareOp { CompareLt, CompareLe, CompareEq, CompareGe, CompareGt, CompareNe }for this operation. Note that arg[0] cannot be equal to CompareNe. arg[1] & 1 If this is zero, y_0 is a parameter. Otherwise it is a variable. arg[1] & 2 If this is zero, y_1 is a parameter. Otherwise it is a variable. arg[1] & 4 If this is zero, y_2 is a parameter. Otherwise it is a variable. arg[1] & 8 If this is zero, y_3 is a parameter. Otherwise it is a variable. arg[2 + j ] for j = 0, 1, 2, 3 is the index corresponding to y_j. |
num_par | is the total number of values in the vector parameter. |
jac_reverse | jac_reverse[i_z] is false (true) if the Jacobian of G with respect to z is always zero (may be non-zero). jac_reverse[ arg[4] ] If y_2 is a variable, jac_reverse[ arg[4] ] is false (true) if the Jacobian with respect to y_2 is always zero (may be non-zero). On input, it corresponds to the function G, and on output it corresponds to the function H. jac_reverse[ arg[5] ] If y_3 is a variable, jac_reverse[ arg[5] ] is false (true) if the Jacobian with respect to y_3 is always zero (may be non-zero). On input, it corresponds to the function G, and on output it corresponds to the function H. |
hes_sparsity | The set with index i_z in hes_sparsity is the Hessian sparsity pattern for the function G where one of the partials is with respect to z. If y_2 is a variable, the set with index arg[4] in hes_sparsity is the Hessian sparsity pattern where one of the partials is with respect to y_2. On input, this pattern corresponds to the function G. On output, this pattern corresponds to the function H. If y_3 is a variable, the set with index arg[5] in hes_sparsity is the Hessian sparsity pattern where one of the partials is with respect to y_3. On input, this pattern corresponds to the function G. On output, this pattern corresponds to the function H. |
Definition at line 1279 of file cond_op.hpp.
Referenced by rev_hes_sweep().