Prev | Next |
ok = afun.hes_sparsity(
parameter_x, type_x, select_x, select_y, pattern_out
)
template <class Base> bool atomic_three<Base>::hes_sparsity( const vector<Base>& parameter_x , const vector<ad_type_enum>& type_x , const vector<bool>& select_x , const vector<bool>& select_y , sparse_rc< vector<size_t> >& pattern_out )
f
,
and Hessian sparsity patterns are computed for
f
.
ax
.
It specifies which domain components are included in
the calculation of
pattern_out
.
If
select_x[j]
is false, then there will be no indices
k
such that either of the following hold:
pattern_out.row()[k] == j
pattern_out.col()[k] == j
.
ay
.
It specifies which range component functions @(@
g_i (x)
@)@ are included in
of
pattern_out
.
pattern_out
does not matter.
Upon return it is the union,
with respect to
i
such that
select_y[i]
is true,
of the sparsity pattern for Hessian of @(@
g_i (x)
@)@.
To be specific, there are non-negative indices
i
,
r
,
c
, and
k
such that
pattern_out.row()[k] == r
pattern_out.col()[k] == c
if and only if
select_y[i]
is true,
select_x[r]
is true,
select_x[c]
is true,
and
@[@
\partial_{x(r)} \partial_{x(c)} g_i(x)
@]@
is possibly non-zero.
Note that the sparsity pattern should be symmetric.
ok
is true.
Otherwise it is false.