/*! Moving an operation sequence from a recorder to a player \param rec the object that was used to record the operation sequence. After this operation, the state of the recording is no longer defined. For example, the \c pod_vector member variables in \c this have been swapped with \c rec . */ void get(recorder<Base>& rec) { size_t i; // Var num_rec_var_ = rec.num_rec_var_; // Op rec_op_.swap(rec.rec_op_); // VecInd rec_vecad_ind_.swap(rec.rec_vecad_ind_); // Arg rec_op_arg_.swap(rec.rec_op_arg_); // Par rec_par_.swap(rec.rec_par_); // Txt rec_text_.swap(rec.rec_text_); // set the number of VecAD vectors num_rec_vecad_vec_ = 0; for(i = 0; i < rec_vecad_ind_.size(); i += rec_vecad_ind_[i] + 1) num_rec_vecad_vec_++; // rec_vecad_ind_ contains size of each VecAD followed by // the parameter indices used to iniialize it. CPPAD_ASSERT_UNKNOWN( i == rec_vecad_ind_.size() ); }
/*! Moving an operation sequence from a recorder to a player \param rec the object that was used to record the operation sequence. After this operation, the state of the recording is no longer defined. For example, the \c pod_vector member variables in \c this have been swapped with \c rec . */ void get(recorder<Base>& rec) { size_t i; // just set size_t values num_var_rec_ = rec.num_var_rec_; num_load_op_rec_ = rec.num_load_op_rec_; // op_rec_ op_rec_.swap(rec.op_rec_); // vec_ind_rec_ vecad_ind_rec_.swap(rec.vecad_ind_rec_); // op_arg_rec_ op_arg_rec_.swap(rec.op_arg_rec_); // par_rec_ par_rec_.swap(rec.par_rec_); // text_rec_ text_rec_.swap(rec.text_rec_); // set the number of VecAD vectors num_vecad_vec_rec_ = 0; for(i = 0; i < vecad_ind_rec_.size(); i += vecad_ind_rec_[i] + 1) num_vecad_vec_rec_++; // vecad_ind_rec_ contains size of each VecAD followed by // the parameter indices used to iniialize it. CPPAD_ASSERT_UNKNOWN( i == vecad_ind_rec_.size() ); }