![]() |
Prev | Next |
h =
f.SparseHessian(
x,
w)
F : B^n \rightarrow B^m
do denote the
AD function
corresponding to f.
The syntax above sets h to the Hessian
\[
h = \dpow{2}{x} \sum_{i=1}^m w_i F_i (x)
\]
This is a preliminary implementation of a method for using the fact
that the matrix is sparse to reduce the amount of computation necessary.
One should use speed tests to verify that results are computed faster
than when using the routine Hessian
.
ADFun<
Base>
f
Note that the ADFun
object f is not const
(see Uses Forward
below).
const
Vector &
x
(see Vector
below)
and its size
must be equal to n, the dimension of the
domain
space for f.
It specifies
that point at which to evaluate the Hessian.
const
Vector &
w
and size
m
.
It specifies the value of
w_i
in the expression
for h.
The more components of
w
that are identically zero,
the more spares the resulting Hessian may be (and hence the more efficient
the calculation of h may be).
Vector
h
and its size is
n * n
.
For
j = 0 , \ldots , n - 1
and
\ell = 0 , \ldots , n - 1
\[
hes [ j * n + \ell ] = \DD{ w^{\rm T} F }{ x_j }{ x_\ell } ( x )
\]
SparseHessian
,
the previous calls to Forward
are undefined.
Hessian
.
They return true
, if they succeed and false
otherwise.