Prev Next ReverseSweep

Reverse Mode Computation of Derivatives of Taylor Coefficients

Syntax
void ReverseSweep(
     size_t 
d,
     size_t 
numvar,
     const player<
Base> *Rec,
     size_t 
J,
     const Base *
Taylor,
     size_t 
K,
     Base *
Partial
)


Rec
The information stored in Rec is a recording of the operations corresponding to a function  \[
     F : B^m \rightarrow B^n
\] 


G
Given the vector  v \in B^n we define the function  G : B^{m \times d} \rightarrow B by  \[
     G(u) = \frac{1}{d !} 
          \sum_{i=1}^n v_i \left[
          \frac{ \partial^p}{ \partial t^d}
          F_i [ u^{(0)} + u^{(1)} t + \cdots + u^{(d)} t^d ]
     \right]_{t=0}
\] 
Note that the scale factor of  1 / d ! converts d-th order derivatives to d-th order Taylor coefficients. The routine ReverseSweep computes all the first order partial derivatives of  G with respect to each of the Taylor coefficients for the independent variables  u^{(j)} for  j = 0 , \ldots , d .

numvar
is the number of rows in the matrices Taylor and Partial. It must also be equal to Rec->TotNumVar().

J
Is the number of columns in the coefficient matrix Taylor. This must be greater than or equal  d+1 .

K
Is the number of columns in the coefficient matrix Partial. This must be greater than or equal  d+1 .

Taylor
For  i = 1 , \ldots , numvar - 1 and  j <= d Taylor[i * J + j] contains the j-th order Taylor coefficients for the variable corresponding to index i.

On Input

Dependent Variables
The vector v is stored in the d-th order components of the last n variables in Partial; i.e., for  i = numvar-n , \ldots , numvar-1 and for  j < d ,
     
Partial[i * K + j] == 0
     
Partial[i * K + d] == v[numvar - i]

Other Variables
The other variable records come before and have initial partials of zero; i.e., for  i = 1, \ldots , numvar-n-1 and  j \leq d ,
     
Partial[i * K + j] ==  0

On Output

Independent Variables
For  i = 1, \ldots , m , and for  j \leq d , Partial[i * K + j] is the partial of  G with respect to  u_i^{(j)} .

Other Variables
For  i = m+1, \ldots , numvar-1 and  j \leq d , Partial[i * K + j] is temporary work space and its output value is not specified.
Input File: cppad/local/reverse_sweep.hpp