First Order Partial Derivative: Driver Routine
Keywords: first order partial derivative: driver routine easy syntax purpose f x j dy vector forone uses forward example

| Prev | Next |  |  |  |  |  |  |

First Order Partial Derivative: Driver Routine
Syntax
`dy = f.ForOne(x, j)`
Purpose
We use F : B n → B m to denote the AD function corresponding to `f` . The syntax above sets `dy` to the partial of F with respect to x j ; i.e., dy = ∂ F ∂ x j ( x ) = [∂ F 0 ∂ x j ( x ) , ⋯ , ∂ F m -1 ∂ x j ( x ) ]
f
The object `f` has prototype `
ADFun<Base> f
` Note that the ADFun object `f` is not `const` (see ForOne 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 partial derivative.
j
The argument `j` has prototype `
size_t j
` an is less than `n` , domain space for `f` . It specifies the component of `F` for which we are computing the partial derivative.
dy
The result `dy` has prototype `
Vector dy
` (see Vector below) and its size is m , the dimension of the range space for `f` . The value of `dy` is the partial of F with respect to x j evaluated at `x` ; i.e., for i = 0 , … , m - 1 . dy [ i ] = ∂ 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.
ForOne Uses Forward
After each call to Forward , the object `f` contains the corresponding Taylor coefficients . After a call to `ForOne`, the zero order Taylor coefficients correspond to `f.Forward(0,x)` and the other coefficients are unspecified.
Example
The routine ForOne is both an example and test. It returns `true`, if it succeeds and `false` otherwise.

Input File: cppad/local/for_one.hpp