Prev Next

Hessian: Easy Driver

Syntax
hes = f.Hessian(xi)

Purpose
We use  F : B^n \rightarrow B^m to denote the AD function corresponding to f. The syntax above sets hes to the Hessian of F_i evaluated at x; i.e.,  \[
     hes = F^{(2)} (x)
\] 


f
The object f has prototype
     ADFun<
Basef
Note that the ADFun object f is not const (see Hessian Uses Forward below).

x
The argument x has prototype
     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.

i
The index i has prototype
     size_t 
i
and is less than m, the dimension of the range space for f. It specifies the component of F for which we are evaluating the Hessian.

hes
The result hes has prototype
     
Vector hes
(see Vector below) and its size is  n * n . For  j = 0 , \ldots , n - 1  and  \ell = 0 , \ldots , n - 1  \[
     hes [ j * n + \ell ] = \DD{ F_i }{ x_j }{ x_\ell } ( x )
\] 


Vector
The type Vector must be a SimpleVector class with elements of type Base. The routine CheckSimpleVector will generate an error message if this is not the case.

Hessian Uses Forward
After each call to Forward , the object f contains the corresponding Taylor coefficients . After Hessian, the previous calls to Forward are undefined.

Example
The routines Hessian.cpp and HesLagrangian.cpp are examples and tests of Hessian. They return true, if they succeed and false otherwise.
Input File: cppad/local/hessian.hpp