CppAD: A C++ Algorithmic Differentiation Package  20130918
template<class Base , class Vector_set >
void CppAD::RevJacSweep ( bool  nz_compare,
size_t  n,
size_t  numvar,
player< Base > *  play,
Vector_set &  var_sparsity 
)

Given the sparsity pattern for the dependent variables, RevJacSweep computes the 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:
nz_compareAre the derivatives with respect to left and right of the expression below considered to be non-zero:
     CondExpRel(left, right, if_true, if_false)
This is used by the optimizer to obtain the correct dependency relations.
nis the number of independent variables on the tape.
numvaris the total number of variables on the tape; i.e., play->num_var_rec(). This is also the number of rows in the entire sparsity pattern RevJac.
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.
var_sparsityFor i = 0 , ... , numvar - 1, (all the variables on the tape) the forward Jacobian sparsity pattern for variable i corresponds to the set with index i in var_sparsity. Input: For i = 0 , ... , numvar - 1, the forward Jacobian sparsity pattern for variable i is an input if i corresponds to a dependent variable. Otherwise the sparsity patten is empty.

Output: For j = 1 , ... , n, the sparsity pattern for the dependent variable with index (j-1) is given by the set with index index j in var_sparsity.

Definition at line 112 of file rev_jac_sweep.hpp.

Referenced by RevSparseJacBool(), and RevSparseJacSet().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines