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

Reverse mode Hessian sparsity operations for LdpOp and LdvOp.

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

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

The C++ source code corresponding to this operation is

	z = v[x]

where v is a VecAD<Base> vector and x is an AD<Base> index.

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., LdpOp or LdvOp (only used for error checking).
i_zis the AD variable index corresponding to the variable z; i.e., the set with index i_z in var_sparsity is the sparsity pattern correpsonding to z.
arg
arg[0] is the offset corresponding to this VecAD vector in the VecAD combined array.
num_combinedis the total number of elements in the VecAD combinded array.
combinedis the VecAD combined array.

combined[ arg[0] - 1 ] is the index of the set corresponding to the vector v in vecad_sparsity. We use the notation i_v for this value; i.e.,
	i_v = combined[ \a arg[0] - 1 ]
var_sparsityThe set with index i_z in var_sparsity is the sparsity pattern for z. This is an output for forward mode operations, and an input for reverse mode operations.
vecad_sparsityThe set with index i_v is the sparsity pattern for the vector v. This is an input for forward mode operations. For reverse mode operations, the sparsity pattern for z is added to the sparsity pattern for v.
Checked Assertions
  • NumArg(op) == 3
  • NumRes(op) == 1
  • 0 < arg[0]
  • arg[0] < num_combined
  • i_v < vecad_sparsity.n_set()
Parameters:
var_jacobianvar_jacobian[i_z] is false (true) if the Jacobian of G with respect to z is always zero (many be non-zero).
vecad_jacobianvecad_jacobian[i_v] is false (true) if the Jacobian with respect to x is always zero (may be non-zero). On input, it corresponds to the function G, and on output it corresponds to the function H.

Definition at line 379 of file load_op.hpp.

Referenced by RevHesSweep().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines