|
template<class Base >
void forward_comp_op_0 |
( |
size_t & |
count, |
|
|
const size_t * |
arg, |
|
|
size_t |
num_par, |
|
|
const Base * |
parameter, |
|
|
size_t |
nc_taylor, |
|
|
Base * |
taylor |
|
) |
| [inline] |
Zero order forward mode execution of op = CompOp.
The C++ source code corresponding to this operation is
where Cop is one of the following: <, <=, == , >=, >, !=.
- 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:
-
count | If the comparision has the same result as when t operation seqeunce was recorded, count is not affected. Otherwise it is incremented by one. |
arg |
arg[0] is static cast to size_t from the enum type
enum CompareOp {
CompareLt,
CompareLe,
CompareEq,
CompareGe,
CompareGt,
CompareNe
}
for this operation.
arg[1] & 1
If this expression is true, the result of the comparison during taping it true. Othwise the result if false.
arg[1] & 2
if this expression is true, left is a variable, otherwise it is a parameter.
arg[1] & 4
if this expression is true, right is a variable, otherwise it is a parameter.
|
num_par | is the lenght of the parameter vector. This value is only used for checking assumptions mentioned below (and is not used at all when NDEBUG is defined). |
parameter | Vector of parameters corresponding to the tape. If left is a parameter, parameter[ arg[2] ] is its value. If right is a parameter, parameter[ arg[3] ] is its value. |
nc_taylor | number of columns in the matrix containing the Taylor coefficients. |
taylor | Matrix of Taylor coefficients. If left is a variable, taylor[ arg[2] * nc_taylor + 0 ] is its value. If right is a variable, taylor[ arg[3] * nc_taylor + 0 ] is its value. |
- Checked Assertions where op is a binary operator:
- NumArg(ComOp) == 4
- NumRes(ComOp) == 0
- arg[0] <= static_cast<size_t>( CompareNe )
- arg[1] != 0 (either left or right is a variable)
- if left is a parameter, arg[2] < num_par
- if right is a parameter, arg[3] < num_par
Definition at line 106 of file comp_op.hpp.
Referenced by forward0sweep(), and forward_sweep().
|