---------------------------------------------------- lines 9-100 of file: include/cppad/core/jacobian.hpp ---------------------------------------------------- {xrst_begin Jacobian} Jacobian: Driver Routine ######################## Syntax ****** | *jac* = *f* . ``Jacobian`` ( *x* ) Purpose ******* We use :math:`F : \B{R}^n \rightarrow \B{R}^m` to denote the :ref:`glossary@AD Function` corresponding to *f* . The syntax above sets *jac* to the Jacobian of *F* evaluated at *x* ; i.e., .. math:: jac = F^{(1)} (x) f * The object *f* has prototype ``ADFun`` < *Base* > *f* Note that the :ref:`ADFun-name` object *f* is not ``const`` (see :ref:`Jacobian@Forward or Reverse` below). x * The argument *x* has prototype ``const`` *Vector* & *x* (see :ref:`Jacobian@Vector` below) and its size must be equal to *n* , the dimension of the :ref:`fun_property@Domain` space for *f* . It specifies that point at which to evaluate the Jacobian. jac *** The result *jac* has prototype *Vector* *jac* (see :ref:`Jacobian@Vector` below) and its size is :math:`m * n`; i.e., the product of the :ref:`fun_property@Domain` and :ref:`fun_property@Range` dimensions for *f* . For :math:`i = 0 , \ldots , m - 1` and :math:`j = 0 , \ldots , n - 1` .. math:: jac[ i * n + j ] = \D{ F_i }{ x_j } ( x ) Vector ****** The type *Vector* must be a :ref:`SimpleVector-name` class with :ref:`elements of type` *Base* . The routine :ref:`CheckSimpleVector-name` will generate an error message if this is not the case. Forward or Reverse ****************** This will use order zero Forward mode and either order one Forward or order one Reverse to compute the Jacobian (depending on which it estimates will require less work). After each call to :ref:`Forward-name` , the object *f* contains the corresponding :ref:`Taylor coefficients` . After a call to ``Jacobian`` , the zero order Taylor coefficients correspond to *f* . ``Forward`` (0, *x* ) and the other coefficients are unspecified. Example ******* {xrst_toc_hidden example/general/jacobian.cpp } The routine :ref:`Jacobian` is both an example and test. It returns ``true`` , if it succeeds and ``false`` otherwise. {xrst_end Jacobian}