lines 564-647 of file: lib/cplusplus/fun.cpp {xrst_begin cpp_fun_hessian} Hessian of an AD Function ######################### Syntax ****** *H* = *f*\ ``.hessian`` ( *x* , *w* ) f * This is either a :ref:`d_fun` or :ref:`a_fun` function object. Upon return, the zero order :ref:`taylor_coefficients` in *f* correspond to the value of *x* . The other Taylor coefficients in *f* are unspecified. f(x) **** We use the notation :math:`f: \B{R}^n \rightarrow \B{R}^m` for the function corresponding to *f* . Note that *n* is the size of :ref:`ax` and *m* is the size of :ref:`ay` in to the constructor for *f* . g(x) **** We use the notation :math:`g: \B{R}^n \rightarrow \B{R}` for the function defined by .. math:: g(x) = \sum_{i=0}^{n-1} w_i f_i (x) x * If *f* is a ``d_fun`` or ``a_fun`` , this argument has prototype | |tab| ``const vec_double&`` *x* | |tab| ``const vec_a_double&`` *x* and its size must be *n* . It specifies the argument value at we are computing the Hessian :math:`g^{(2)}(x)`. w * If *f* is a ``d_fun`` or ``a_fun`` , this argument has prototype | |tab| ``const vec_double&`` *w* | |tab| ``const vec_a_double&`` *w* and its size must be *m* . It specifies the vector *w* in the definition of :math:`g(x)` above. H * If *f* is a ``d_fun`` or ``a_fun`` , the result has prototype | |tab| ``vec_double`` *H* | |tab| ``vec_a_double`` *H* and its size is *n* ``*`` *n* . For *i* between zero and *n* -1 and *j* between zero and *n* -1 , .. math:: H [ i * n + j ] = \frac{ \partial^2 g }{ \partial x_i \partial x_j } (x) {xrst_toc_hidden example/cplusplus/fun_hessian_xam.cpp } Example ******* :ref:`fun_hessian_xam.cpp-name` {xrst_end cpp_fun_hessian}