CppAD: A C++ Algorithmic Differentiation Package  20130102
template<class Base >
template<class VectorBase , class VectorSet , class VectorSize >
size_t ADFun< Base >::SparseJacobianForward ( const VectorBase &  x,
const VectorSet &  p,
const VectorSize &  row,
const VectorSize &  col,
VectorBase &  jac,
sparse_jacobian_work work 
)

Compute user specified subset of a sparse Jacobian using forward mode.

The C++ source code corresponding to this operation is

	SparceJacobianForward(x, p, row, col, jac, work)
Template Parameters:
Baseis the base type for the recording that is stored in this ADFun<Base object.
VectorBaseis a simple vector class with elements of type Base.
VectorSetis a simple vector class with elements of type bool or std::set<size_t>.
VectorSizeis a simple vector class with elements of type size_t.
Parameters:
xis a vector specifing the point at which to compute the Jacobian.
pis the sparsity pattern for the Jacobian that we are calculating.
rowis the vector of row indices for the returned Jacobian values.
colis the vector of columns indices for the returned Jacobian values. It must have the same size are r.
jacis the vector of Jacobian values. It must have the same size are r. The return value jac[k] is the partial of the row[k] component of the function with respect the the col[k] of its argument.
workwork contains information that depends on the function object, sparsity pattern, row vector, and col vector. These work values are computed by SparseJacobianForward. If they are not the same between calls, work.clear() must be called to reinitialize them. To be more specific: user_row is a copy of row with the value m at the end (m is the range dimension), user_col is a copy of col with the value n at the end (n is the domain dimension), sort_col is the index vector that sorts the user_col vector with the extra value K at the end (K is the size of jac).
Returns:
Is the number of first order forward sweeps used to compute the requested Jacobian values. The total work, not counting the zero order forward sweep, or the time to combine computations, is proportional to this return value.

Definition at line 801 of file sparse_jacobian.hpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines