CppAD: A C++ Algorithmic Differentiation Package  20130102
template<class Base , class Vector_set >
void RevHesSweep ( size_t  n,
size_t  numvar,
player< Base > *  play,
Vector_set &  for_jac_sparse,
bool *  RevJac,
Vector_set &  rev_hes_sparse 
)

Given the forward Jacobian sparsity pattern for all the variables, and the reverse Jacobian sparsity pattern for the dependent variables, RevHesSweep computes the Hessian sparsity pattern for all the independent variables.

Template Parameters:
Basebase type for the operator; i.e., this operation sequence was recorded using AD< Base > and computations by this routine are done using type Base.
Vector_setis the type used for vectors of sets. It can be either sparse_pack, sparse_set, or sparse_list.
Parameters:
nis the number of independent variables on the tape.
numvaris the total number of variables on the tape; i.e., play->num_rec_var(). This is also the number of rows in the entire sparsity pattern rev_hes_sparse.
playThe information stored in play is a recording of the operations corresponding to a function

\[ F : {\bf R}^n \rightarrow {\bf R}^m \]

where $ n $ is the number of independent variables and $ m $ is the number of dependent variables. The object play is effectly constant. It is not declared const because while playing back the tape the object play holds information about the currentl location with in the tape and this changes during playback.
for_jac_sparseFor i = 0 , ... , numvar - 1, (for all the variables on the tape), the forward Jacobian sparsity pattern for the variable with index i corresponds to the set with index i in for_jac_sparse.
RevJacInput: For i = 0, ... , numvar - 1 the if the variable with index i on the tape is an dependent variable and included in the Hessian, RevJac[ i ] is equal to true, otherwise it is equal to false.

Output: The values in RevJac upon return are not specified; i.e., it is used for temporary work space.
rev_hes_sparseThe reverse Hessian sparsity pattern for the variable with index i corresponds to the set with index i in rev_hes_sparse.

Input: For i = 0 , ... , numvar - 1 the reverse Hessian sparsity pattern for the variable with index i is empty.

Output: For j = 1 , ... , n, the reverse Hessian sparsity pattern for the independent dependent variable with index (j-1) is given by the set with index j in rev_hes_sparse. The values in the rest of rev_hes_sparse are not specified; i.e., they are used for temporary work space.

Definition at line 104 of file rev_hes_sweep.hpp.

Referenced by RevSparseHesBool(), and RevSparseHesSet().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines