Prev Next

Jacobian: Driver Routine

Syntax
jac = f.Jacobian(x)

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


f
The object f has prototype
     ADFun<
Basef
Note that the ADFun object f is not const (see Jacobian 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 Jacobian.

jac
The result jac has prototype
     
Vector jac
(see Vector below) and its size is  m * n ; i.e., the product of the domain and range dimensions for f. For  i = 0 , \ldots , m - 1  and  j = 0 , \ldots , n - 1  \[.
     jac[ i * n + j ] = \D{ F_i }{ x_j } ( 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.

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

Example
The routine Jacobian is both an example and test. It returns true, if it succeeds and false otherwise.
Input File: cppad/local/jacobian.hpp