Prev | Next |
f.for_hes_sparsity(
select_domain, select_range, internal_bool, pattern_out
)
f
.
Fix a diagonal matrix @(@
D \in \B{R}^{n \times n}
@)@,
a vector @(@
s \in \B{R}^m
@)@ and define the function
@[@
H(x) = D ( s^\R{T} F )^{(2)} ( x ) D
@]@
Given the sparsity for @(@
D
@)@ and @(@
s
@)@,
for_hes_sparsity
computes a sparsity pattern for @(@
H(x)
@)@.
f
and does not depend on
the argument
x
.
BoolVector
is a SimpleVector
class with
elements of type
bool
.
SizeVector
is a SimpleVector
class with
elements of type
size_t
.
f
has prototype
ADFun<Base> f
select_domain
has prototype
const BoolVector& select_domain
It has size @(@
n
@)@ and specifies which components of the diagonal of
@(@
D
@)@ are non-zero; i.e.,
select_domain[j]
is true
if and only if @(@
D_{j,j}
@)@ is possibly non-zero.
select_range
has prototype
const BoolVector& select_range
It has size @(@
m
@)@ and specifies which components of the vector
@(@
s
@)@ are non-zero; i.e.,
select_range[i]
is true
if and only if @(@
s_i
@)@ is possibly non-zero.
sparse_rc<SizeVector>& pattern_out
This input value of
pattern_out
does not matter.
Upon return
pattern_out
is a sparsity pattern for @(@
H(x)
@)@.
pattern_out
is a sparsity pattern for
@(@
(s^\R{T} F) F^{(2)} ( x )
@)@.
s
provides the information so that
'dead ends' are not included in the sparsity pattern.