Atomic Reverse Jacobian Sparsity Patterns
Keywords: atomic reverse jacobian sparsity patterns syntax purpose implementation q rt st ok examples define rev_sparse_jac use

| Prev | Next |  |  |  |  |  | atomic_rev_sparse_jac |

Atomic Reverse Jacobian Sparsity Patterns
Syntax
`ok = afun.rev_sparse_jac(q, rt, st)`
Purpose
This function is used by RevSparseJac to compute Jacobian sparsity patterns. For a fixed matrix R ∈ B q × m , the Jacobian of R * f ( x ) with respect to x ∈ B q is S ( x ) = R * f ( 1 ) ( x ) Given a sparsity pattern for R , `rev_sparse_jac` computes a sparsity pattern for S ( x ) .
Implementation
If you are using RevSparseJac , 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 rows in R ∈ B q × m and the Jacobian S ( x ) ∈ B q × n .
rt
This argument has prototype `
const atomic_sparsity& rt
` and is a atomic_sparsity pattern for R T ∈ B m × q .
st
This argument has prototype `
atomic_sparsity& st
` The input value of its elements are not specified (must not matter). Upon return, `s` is a atomic_sparsity pattern for S ( x ) T ∈ B n × q .
ok
The return value `ok` has prototype `
bool ok
` If it is `true`, the corresponding evaluation succeeded, otherwise it failed.
Examples
Define rev_sparse_jac
The following files contain example atomic `rev_sparse_jac` functions: norm_sq.cpp , reciprocal.cpp , tangent.cpp , matrix_mul.hpp .
Use rev_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