Atomic Forward Jacobian Sparsity Patterns
Keywords: atomic forward jacobian sparsity patterns syntax purpose implementation q r s ok examples define for_sparse_jac use

| Prev | Next |  |  |  |  |  | atomic_for_sparse_jac |

Atomic Forward Jacobian Sparsity Patterns
Syntax
`ok = afun.for_sparse_jac(q, r, s)`
Purpose
This function is used by ForSparseJac to compute Jacobian sparsity patterns. For a fixed matrix R ∈ B n × q , the Jacobian of f ( x + R * u ) with respect to u ∈ B q is S ( x ) = f ( 1 ) ( x ) * R Given a sparsity pattern for R , `for_sparse_jac` computes a sparsity pattern for S ( x ) .
Implementation
If you are using ForSparseJac , this virtual function must be defined by the atomic_user class.
q
The argument `q` has prototype `
size_t q
` It specifies the number of columns in R ∈ B n × q and the Jacobian S ( x ) ∈ B m × q .
r
This argument has prototype `
const atomic_sparsity& r
` and is a atomic_sparsity pattern for R ∈ B n × q .
s
This argument has prototype `
atomic_sparsity& s
` The input values of its elements are not specified (must not matter). Upon return, `s` is a atomic_sparsity pattern for S ( x ) ∈ B m × q .
ok
The return value `ok` has prototype `
bool ok
` If it is `true`, the corresponding evaluation succeeded, otherwise it failed.
Examples
Define for_sparse_jac
The following files contain example atomic `for_sparse_jac` functions: norm_sq.cpp , reciprocal.cpp , tangent.cpp , matrix_mul.hpp .
Use for_sparse_jac
The following are links to user atomic function constructor uses: norm_sq.cpp , reciprocal.cpp , tangent.cpp , mat_mul.cpp .

Input File: cppad/local/atomic_base.hpp