CppAD: A C++ Algorithmic Differentiation Package 20110419
template<class Base >
template<class VectorSet >
VectorSet ADFun< Base >::ForSparseJac ( size_t  q,
const VectorSet &  r 
)

User API for Jacobian sparsity patterns using forward mode.

The C++ source code corresponding to this operation is

	s = f.ForSparseJac(q, r)
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 columns in the matrix $ R $.
ris a sparsity pattern for the matrix $ R $.
Returns:
If VectorSet::value_type is bool, the return value s is a vector with size m*q 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 s is a vector of sets with size m and with all its elements between zero and q - 1. The value of s is the sparsity pattern for the matrix

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

where $ F $ is the function corresponding to the operation sequence and x is any argument value.
Side Effects
If 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() == total_num_var_
	for_jac_sparse_pack_.end() == q
	for_jac_sparse_set_.n_set()  == 0
	for_jac_sparse_set_.end()  == 0


If 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()   == total_num_var_
	for_jac_sparse_set_.end()   == q
	for_jac_sparse_pack_.n_set()  == 0
	for_jac_sparse_pack_.end()  == 0

Definition at line 520 of file for_sparse_jac.hpp.