Reverse Mode Second Partial Derivative Driver
Keywords: reverse mode second partial derivative driver order easy syntax purpose f x i j ddw vectorbase vectorsize_t revtwo uses forward examples

| Prev | Next |  |  |  |  |  |  |

Reverse Mode Second Partial Derivative Driver
Syntax
`ddw = f.RevTwo(x, i, j)`
Purpose
We use F : B n → B m to denote the AD function corresponding to `f` . The syntax above sets ddw [ k * p + ℓ ] = ∂ 2 F i [ ℓ ] ∂ x j [ ℓ ] ∂ x k ( x ) for k = 0 , … , n -1 and ℓ = 0 , … , p , where p is the size of the vectors `i` and `j` .
f
The object `f` has prototype `
ADFun<Base> f
` Note that the ADFun object `f` is not `const` (see RevTwo Uses Forward below).
x
The argument `x` has prototype `
const VectorBase &x
` (see VectorBase 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 partial derivatives listed above.
i
The argument `i` has prototype `
const VectorSize_t &i
` (see VectorSize_t below) We use `p` to denote the size of the vector `i` . All of the indices in `i` must be less than `m` , the dimension of the range space for `f` ; i.e., for ℓ = 0 , … , p -1 , i [ ℓ ] < m .
j
The argument `j` has prototype `
const VectorSize_t &j
` (see VectorSize_t below) and its size must be equal to `p` , the size of the vector `i` . All of the indices in `j` must be less than `n` ; i.e., for ℓ = 0 , … , p -1 , j [ ℓ ] < n .
ddw
The result `ddw` has prototype `
VectorBase ddw
` (see VectorBase below) and its size is n * p . It contains the requested partial derivatives; to be specific, for k = 0 , … , n - 1 and ℓ = 0 , … , p - 1 ddw [ k * p + ℓ ] = ∂ 2 F i [ ℓ ] ∂ x j [ ℓ ] ∂ x k ( x )
VectorBase
The type `VectorBase` must be a SimpleVector class with elements of type Base . The routine CheckSimpleVector will generate an error message if this is not the case.
VectorSize_t
The type `VectorSize_t` must be a SimpleVector class with elements of type size_t . The routine CheckSimpleVector will generate an error message if this is not the case.
RevTwo Uses Forward
After each call to Forward , the object `f` contains the corresponding Taylor coefficients . After a call to `RevTwo`, the zero order Taylor coefficients correspond to `f.Forward(0, x)` and the other coefficients are unspecified.
Examples
The routine RevTwo is both an example and test. It returns `true`, if it succeeds and `false` otherwise.

Input File: cppad/local/rev_two.hpp