CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
template<class Base >
template<class VectorSet >
VectorSet CppAD::ADFun< Base >::RevSparseJac ( size_t  q,
const VectorSet &  r,
bool  transpose = false,
bool  dependency = false 
)

User API for Jacobian sparsity patterns using reverse mode.

The C++ source code corresponding to this operation is

     s = f.RevSparseJac(q, r, transpose, dependency)
Template Parameters
Baseis the base type for this recording.
VectorSetis a simple vector with elements of type bool. or std::set<size_t>.
Parameters
qis the number of rows in the matrix $ R $.
ris a sparsity pattern for the matrix $ R $.
transposeare the sparsity patterns for $ R $ and $ S(x) $ transposed.
dependencyAre 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.
Returns
If transpose is false (true), the return value is a sparsity pattern for $ S(x) $ ( $ S(x)^T $) where

\[ S(x) = R * F^{(1)} (x) \]

and $ F $ is the function corresponding to the operation sequence and x is any argument value. If VectorSet::value_type is bool, the return value has size $ q * n $ ( $ n * q $). If VectorSet::value_type is std::set<size_t>, the return value has size $ q $ ( $ n $) and with all its elements between zero and $ n - 1 $ ( $ q - 1 $).

Definition at line 483 of file rev_sparse_jac.hpp.

Referenced by CppAD::ipopt::solve_callback< Dvector, ADvector, FG_eval >::solve_callback().