CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
template<class Base >
void CppAD::local::optimize::optimize_run ( const std::string &  options,
size_t  n,
CppAD::vector< size_t > &  dep_taddr,
const player< Base > *  play,
recorder< Base > *  rec 
)

Convert a player object to an optimized recorder object.

Template Parameters
Basebase type for the operator; i.e., this operation was recorded using AD< Base > and computations by this routine are done using type Base.
Parameters
options
  • If the sub-string "no_conditional_skip" appears, conditional skip operations will not be generated. This may make the optimize routine use significantly less memory and take significantly less time.
  • If the sub-string "no_compare_op" appears, then comparison operators will be removed from the optimized tape. These operators are necessary for the compare_change function to be be meaningful in the resulting recording. On the other hand, they are not necessary and take extra time when compare_change is not used.
  • If the sub-string "no_print_for" appears, then print forward (PriOp) operators will be removed from the optimized tape. These operators are useful for reporting problems evaluating derivatives at independent variable values different from those used to record a function.
nis the number of independent variables on the tape.
dep_taddrOn input this vector contains the indices for each of the dependent variable values in the operation sequence corresponding to play. Upon return it contains the indices for the same variables but in the operation sequence corresponding to rec.
playThis is the operation sequence that we are optimizing. It is essentially const, except for play back state which changes while it plays back the operation seqeunce.
recThe input contents of this recording does not matter. Upon return, it contains an optimized verison of the operation sequence corresponding to play.

Definition at line 85 of file optimize_run.hpp.