CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
template<class Base >
struct_size_pair CppAD::local::optimize::record_csum ( const player< Base > *  play,
const vector< struct_opt_op_info > &  opt_op_info,
const CppAD::vector< struct struct_old2new > &  old2new,
size_t  current,
recorder< Base > *  rec,
struct_csum_stacks &  work 

Recording a cummulative cummulative summation.

playplayer object corresponding to the old recroding.
opt_op_infomapping from old index to operator index to operator information
old2newmapping from old operator index to information about the new recording.
currentis the index in the old operation sequence for the variable corresponding to the result for the current operator. We use the notation i_op = play->var2op(current). It follows that NumRes( opt_op_info[i_op].op ) > 0. If 0 < j_op < i_op, either opt_op_info[j_op].usage == csum_usage, opt_op_info[j_op].usage = no_usage, or old2new[j_op].new_var != 0.
recis the object that will record the new operations.
is the operator and variable indices in the new operation sequence.
workIs temporary work space. On input and output, work.op_stack, work.add_stack, and work.sub_stack, are all empty. These stacks are passed in so that they are created once and then be reused with calls to record_csum.
opt_op_info[i_o].op must be one of AddpvOp, AddvvOp, SubpvOp, SubvpOp, SubvvOp. opt_op_info[i_op].usage != no_usage and ! opt_op_info[i_op].usage == csum_usage. Furthermore opt_op_info[j_op].usage == csum_usage is true from some j_op that corresponds to a variable that is an argument to opt_op_info[i_op].

Definition at line 63 of file record_csum.hpp.

Referenced by optimize_run().