Prev Next

@(@\newcommand{\B}[1]{ {\bf #1} } \newcommand{\R}[1]{ {\rm #1} }@)@
Jacobian of an AD Function

Syntax
J = af.jacobian(x)

af
This object has prototype
     a_fun 
af
Note that its state is changed by this operation. The zero order Taylor coefficients in af correspond to the value of x . The other Taylor coefficients in af are unspecified.

f(x)
We use the notation @(@ f: \B{R}^n \rightarrow \B{R}^m @)@ for the function corresponding to af . Note that n is the size of ax and m is the size of ay in to the constructor for af .

x
This argument has prototype
     const vec_double& 
x
and its size must be n . It specifies the argument value at we are computing the Jacobian @(@ f'(x) @)@.

J
The result has prototype
     vec_double 
J
and its size is m*n . For i between zero and m-1 and j between zero and n-1 , @[@ J [ i * n + j ] = \frac{ \partial f_i }{ \partial x_j } (x) @]@

Example
C++ , Octave , Perl , Python .
Input File: lib/a_fun.cpp