CppAD: A C++ Algorithmic Differentiation Package
20130102
|
void forward_load_p_op_0 | ( | size_t | i_z, |
addr_t * | arg, | ||
size_t | num_par, | ||
const Base * | parameter, | ||
size_t | nc_taylor, | ||
Base * | taylor, | ||
size_t | nc_combined, | ||
const bool * | variable, | ||
const size_t * | combined | ||
) | [inline] |
Zero order forward mode implementation of op = LdpOp.
The C++ source code corresponding to this operation is
z = y[x]
where y is a VecAD<Base> vector and x is an AD<Base> index. We define the index corresponding to y[x] by
i_y_x = combined[ arg[0] + i_vec ]
where i_vec is defined under the heading arg[1] below:
Base | base type for the operator; i.e., this operation was recorded using AD< Base > and computations by this routine are done using type Base. |
i_z | is the AD variable index corresponding to the variable z. |
arg | arg[0] is the offset of this VecAD vector relative to the beginning of the combined VecAD array. arg[1] If this is the LdpOp operation (the index x is a parameter), i_vec is defined by i_vec = arg[1] i_vec = floor( taylor[ arg[1] * nc_taylor + 0 ] ) arg[2] Input: The input value of arg[2] does not matter. Output: If y[x] is a parameter, arg[2] is set to zero (which is not a valid variable index). If y[x] is a variable, arg[2] is set to the variable index corresponding to y[x]; i.e. i_y_x. |
num_par | is the number of parameters in parameter. |
parameter | If y[x] is a parameter, parameter [ i_y_x ] is its value. |
nc_taylor | number of columns in the matrix containing the Taylor coefficients. |
taylor | Input: in LdvOp case, taylor[ arg[1] * nc_taylor + 0 ] is used to compute the index in the definition of i_vec above Input: if y[x] is a variable, taylor[ i_y_x * nc_taylor + 0 ] is the zero order Taylor coefficient for y[x]. Output: taylor[ i_z * nc_taylor + 0 ] is the zero order Taylor coefficient for the variable z. |
nc_combined | is the total number of elements in the combined VecAD array. |
variable | If variable [ arg[0] + i_vec ] is true, y[x] is a variable. Otherwise it is a parameter. |
combined | Input: combined[ arg[0] - 1 ] is the number of elements in the VecAD vector containing this element. Input: combined[ arg[0] + i_vec ] if y[x] is a variable, i_y_x is its index in the Taylor coefficient array taylor. Otherwise, i_y_x is its index in parameter array parameter. |
Definition at line 31 of file load_op.hpp.
Referenced by forward0sweep(), and forward_sweep().