CppAD: A C++ Algorithmic Differentiation Package
20130102
|
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)
Base | is the base type for the recording that is stored in this ADFun<Base object. |
VectorBase | is a simple vector class with elements of type Base. |
VectorSet | is a simple vector class with elements of type bool or std::set<size_t> . |
VectorSize | is a simple vector class with elements of type size_t . |
x | is a vector specifing the point at which to compute the Jacobian. |
p | is the sparsity pattern for the Jacobian that we are calculating. |
row | is the vector of row indices for the returned Jacobian values. |
col | is the vector of columns indices for the returned Jacobian values. It must have the same size are r. |
jac | is 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. |
work | work 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 ). |
Definition at line 801 of file sparse_jacobian.hpp.