|
template<class Base >
void forward_store_vv_op_0 |
( |
size_t |
i_z, |
|
|
const size_t * |
arg, |
|
|
size_t |
num_par, |
|
|
size_t |
nc_taylor, |
|
|
Base * |
taylor, |
|
|
size_t |
nc_combined, |
|
|
bool * |
variable, |
|
|
size_t * |
combined |
|
) |
| [inline] |
Zero order forward mode implementation of op = StvvOp.
The C++ source code corresponding to this operation is
where v is a VecAD<Base> vector, x is an AD<Base> object, and y is AD<Base> or Base objects. We define the index corresponding to v[x] by
i_v_x = combined[ arg[0] + i_vec ]
where i_vec is defined under the heading arg[1] below:
- Template Parameters:
-
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. |
- Parameters:
-
i_z | is the index corresponding to the previous variable on the tape (only used for error checking). |
arg |
arg[0] is the offset of this VecAD vector relative to the beginning of the combined VecAD array.
arg[1]
If this is a StppOp or StpvOp operation (the index x is a parameter), i_vec is defined by If this is a StvpOp or StvvOp operation (the index x is a variable), i_vec is defined by
i_vec = floor( taylor[ arg[1] * nc_taylor + 0 ] )
where floor(c) is the greatest integer less that or equal c.
arg[2]
index corresponding to the third operand for this operator; i.e. the index corresponding to y. |
num_par | is the total number of parameters on the tape (only used for error checking). |
nc_taylor | number of columns in the matrix containing the Taylor coefficients. |
taylor | Input: in StvpOp and StvvOp cases, taylor[ arg[1] * nc_taylor + 0 ] is used to compute the index in the definition of i_vec above |
nc_combined | is the total number of elements in the combined VecAD array. |
variable | Output: If y is a varable (StpvOp or StvvOp), variable [ arg[0] + i_vec ] is set to true. Otherwise y is a paraemter (StppOp or StvpOp) and variable [ arg[0] + i_vec ] is set to false. |
combined | Output: combined [ arg[0] + i_vec ] is set equal to arg[2]. |
- Check User Errors
- Check that the index is with in range; i.e. i_vec < combined[ arg[0] - 1 ] Note that, if x is a parameter, is the corresponding vector index and it does not change. In this case, the error above should be detected during tape recording.
- Checked Assertions
- combined != CPPAD_NULL
- variable != CPPAD_NULL
- NumArg(op) == 3
- NumRes(op) == 0
- 0 < arg[0]
- arg[0] + i_vec < nc_combined
- if y is a parameter, arg[2] < num_par
- if x is a variable, arg[1] <= i_z
- if y is a variable, arg[2] <= i_z
Definition at line 129 of file store_op.hpp.
Referenced by forward0sweep(), and forward_sweep().
|