Prev Next

@(@\newcommand{\W}[1]{ \; #1 \; } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\B}[1]{ {\bf #1} } \newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} } \newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} } \newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} } \newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }@)@This is cppad-20221105 documentation. Here is a link to its current documentation .
First Order Derivative: Driver Routine

Syntax
dw = f.RevOne(xi)

Purpose
We use @(@ F : \B{R}^n \rightarrow \B{R}^m @)@ to denote the AD function corresponding to f . The syntax above sets dw to the derivative of @(@ F_i @)@ with respect to @(@ x @)@; i.e., @[@ dw = F_i^{(1)} (x) = \left[ \D{ F_i }{ x_0 } (x) , \cdots , \D{ F_i }{ x_{n-1} } (x) \right] @]@

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

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 @)@ that we are computing the derivative of.

dw
The result dw has prototype
    
Vector dw
(see Vector below) and its size is n , the dimension of the domain space for f . The value of dw is the derivative of @(@ F_i @)@ evaluated at x ; i.e., for @(@ j = 0 , \ldots , n - 1 @)@ @[@ . dw[ 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.

RevOne Uses Forward
After each call to Forward , the object f contains the corresponding Taylor coefficients . After a call to RevOne, the zero order Taylor coefficients correspond to f.Forward(0, x) and the other coefficients are unspecified.

Example
The routine RevOne is both an example and test. It returns true, if it succeeds and false otherwise.
Input File: include/cppad/core/rev_one.hpp