Atomic Reverse Hessian Sparsity Patterns
Keywords: atomic reverse hessian sparsity patterns syntax purpose implementation vx s t q r u v examples define rev_sparse_hes use

| Prev | Next |  |  |  |  |  | atomic_rev_sparse_hes |

Atomic Reverse Hessian Sparsity Patterns
Syntax
`ok = afun.rev_sparse_hes(vx, s, t, q, r, u, v)`
Purpose
This function is used by RevSparseHes to compute Hessian sparsity patterns. There is an unspecified scalar valued function g : B m → B . Given a sparsity pattern for R ∈ B n × q , and information about the function z = g ( y ) , this routine computes the sparsity pattern for V ( x ) = ( g ∘ f ) ( 2 ) ( x ) R
Implementation
If you are using and RevSparseHes , this virtual function must be defined by the atomic_user class.
vx
The argument `vx` has prototype `
const CppAD:vector<bool>& vx
` `vx.size() == n` , and for j = 0 , … , n -1 , `vx[j]` is true if and only if `ax[j]` is a variable in the corresponding call to `
afun(ax, ay, id)
`
s
The argument `s` has prototype `
const CppAD:vector<bool>& s
` and its size is `m` . It is a sparsity pattern for S ( x ) = g ( 1 ) ( y ) ∈ B 1 × m .
t
This argument has prototype `
CppAD:vector<bool>& t
` and its size is `m` . The input values of its elements are not specified (must not matter). Upon return, `t` is a sparsity pattern for T ( x ) ∈ B 1 × n where T ( x ) = ( g ∘ f ) ( 1 ) ( x ) = S ( x ) * f ( 1 ) ( x )
q
The argument `q` has prototype `
size_t q
` It specifies the number of columns in R ∈ B n × q , U ( x ) ∈ B m × q , and V ( x ) ∈ B n × q .
r
This argument has prototype `
const atomic_sparsity& r
` and is a atomic_sparsity pattern for R ∈ B n × q .
u
This argument has prototype `
const atomic_sparsity& u
` and is a atomic_sparsity pattern for U ( x ) ∈ B m × q which is defined by U ( x ) = ∂ u { ∂ y g [ y + f ( 1 ) ( x ) R u ] } u = 0 = ∂ u { g ( 1 ) [ y + f ( 1 ) ( x ) R u ] } u = 0 = g ( 2 ) ( y ) f ( 1 ) ( x ) R
v
This argument has prototype `
atomic_sparsity& v
` The input value of its elements are not specified (must not matter). Upon return, `v` is a atomic_sparsity pattern for V ( x ) ∈ B n × q which is defined by V ( x ) = ∂ u [ ∂ x ( g ∘ f ) ( x + R u ) ] u = 0 = ∂ u [ ( g ∘ f ) ( 1 ) ( x + R u ) ] u = 0 = ( g ∘ f ) ( 2 ) ( x ) R = f ( 1 ) ( x ) T g ( 2 ) ( y ) f ( 1 ) ( x ) R + ∑ i = 1 m g i ( 1 ) ( y ) f i ( 2 ) ( x ) R = f ( 1 ) ( x ) T U ( x ) + ∑ i = 1 m S i ( x ) f i ( 2 ) ( x ) R
Examples
Define rev_sparse_hes
The following files contain example atomic `rev_sparse_hes` functions: norm_sq.cpp , reciprocal.cpp , tangent.cpp , matrix_mul.hpp .
Use rev_sparse_hes
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