|   | Prev | Next | 
work = module_ref sparse_hes_work()
n_sweep = af.sparse_hes(subset, x, r, pattern, work)
af
.
Given a vector @(@
r \in \B{R}^m
@)@, define
@[@
	H(x) = (r^\R{T} F)^{(2)} ( x )
@]@
This routine takes advantage of sparsity when computing elements
of the Hessian @(@
H(x)
@)@.
     ADFun<Base> af
af
 are affected
by this operation; see
uses forward
 below.
     sparse_rcv& subset
n
; i.e.,
subset.nr() == n
 and 
subset.nc() == n
.
It specifies which elements of the Hessian are computed.
The input value of its value vector
subset.val()
 does not matter.
Upon return it contains the value of the corresponding elements
of the Jacobian.
All of the row, column pairs in 
subset
 must also appear in
pattern
; i.e., they must be possibly non-zero.
     const vec_double& x
n
.
It specifies the point at which to evaluate the Hessian @(@
H(x)
@)@.
     const vec_double& r
m
.
It specifies the multiplier for each component of @(@
F(x)
@)@;
i.e., @(@
r_i
@)@ is the multiplier for @(@
F_i (x)
@)@.
     const sparse_rc& pattern
n
; i.e.,
pattern.nr() == n
 and 
pattern.nc() == n
.
It is a sparsity pattern for the Hessian @(@
H(x)
@)@.
This argument is not used (and need not satisfy any conditions),
when work
 is non-empty.
     sparse_hes_work& work
work.clear()
, as empty.
If it is empty, information is stored in 
work
.
This can be used to reduce computation when
a future call is for the same object 
af
,
and the same subset of the Hessian.
If either of these values change, use 
work.clear()
 to
empty this structure.
n_sweep
 has prototype
     int n_sweep
af
 contains the corresponding Taylor coefficients
for all the variables in the operation sequence..
After a call to sparse_hes
the zero order coefficients correspond to
     af.forward(0, x)