|
CppAD: A C++ Algorithmic Differentiation Package
20171217
|
| VectorSet CppAD::ADFun< Base >::ForSparseJac | ( | size_t | q, |
| const VectorSet & | r, | ||
| bool | transpose = false, |
||
| bool | dependency = false |
||
| ) |
User API for Jacobian sparsity patterns using forward mode.
The C++ source code corresponding to this operation is
s = f.ForSparseJac(q, r, transpose, dependency)
| Base | is the base type for this recording. |
| VectorSet | is a simple vector with elements of type bool or std::set<size_t>. |
| q | is the number of columns in the matrix . |
| r | is a sparsity pattern for the matrix . |
| transpose | are sparsity patterns for and transposed. |
| dependency | Are the derivatives with respect to left and right of the expression below considered to be non-zero: CondExpRel(left, right, if_true, if_false)
|
transpose is false (true), the return value is a sparsity pattern for
(
) where
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
(
). where m is the number of dependent variables corresponding to the operation sequence stored in f. If VectorSet::value_type is std::set<size_t>, the return value has size
(
) and with all its elements between zero and
(
).VectorSet::value_type is bool, the forward sparsity pattern for all of the variables on the tape is stored in for_jac_sparse_pack__. In this case for_jac_sparse_pack_.n_set() == num_var_tape_
for_jac_sparse_pack_.end() == q
for_jac_sparse_set_.n_set() == 0
for_jac_sparse_set_.end() == 0
VectorSet::value_type is std::set<size_t>, the forward sparsity pattern for all of the variables on the tape is stored in for_jac_sparse_set__. In this case for_jac_sparse_set_.n_set() == num_var_tape_
for_jac_sparse_set_.end() == q
for_jac_sparse_pack_.n_set() == 0
for_jac_sparse_pack_.end() == 0
Definition at line 560 of file for_sparse_jac.hpp.
Referenced by CppAD::ipopt::solve_callback< Dvector, ADvector, FG_eval >::solve_callback().