1 # ifndef CPPAD_LOCAL_PLAYER_HPP
2 # define CPPAD_LOCAL_PLAYER_HPP
16 # include <cppad/local/is_pod.hpp>
18 namespace CppAD {
namespace local {
118 size_t addr_t_max = size_t( std::numeric_limits<addr_t>::max() );
150 { num_vecad_vec_rec_++;
171 for(
addr_t i_op = 0; i_op < num_op; ++i_op)
201 arg_index += op_arg[0] + op_arg[1] + 4;
218 arg_index += 7 + op_arg[4] + op_arg[5];
239 for(
size_t i_op = 1; i_op < num_op; ++i_op)
261 for(
size_t i = 0; i < num_op; i++)
355 {
addr_t num_add = op_arg[0];
356 addr_t num_sub = op_arg[1];
357 for(
addr_t j = 0; j < num_add + num_sub; j++)
405 arg_var_bound = var_index;
489 size_t& var_index )
const
522 size_t& user_n )
const
528 user_old = op_arg[1];
533 size_t user_index = size_t( op_arg[0] );
536 if( user_atom == CPPAD_NULL )
539 +
": atomic_base function has been deleted";
size_t num_var_rec_
Number of variables in the recording.
#define CPPAD_ASSERT_KNOWN(exp, msg)
Check that exp is true, if not print msg and terminate execution.
void resize(size_t n)
resize the vector (existing elements preserved when n <= capacity_).
size_t num_par_rec(void) const
Fetch number of parameters in the recording.
static std::vector< atomic_base * > & class_object(void)
List of all the object in this class.
pod_vector< Base > par_vec_
The parameters in the recording. Note that Base may not be plain old data, so use false in consructor...
size_t num_vec_ind_rec(void) const
Fetch number of VecAD indices in the recording.
CPPAD_TAPE_ADDR_TYPE addr_t
size_t num_load_op_rec(void) const
Fetch number of vecad load operations.
size_t Memory(void) const
Fetch a rough measure of amount of memory used to store recording using just lengths, not capacities; see the heading size_op_arg in the file seq_property.omh.
const char * GetTxt(size_t i) const
Fetch a '\0' terminated string from the recording.
size_t NumArg(OpCode op)
Number of arguments for a specified operator.
Class used to store and play back an operation sequence recording.
const Base * GetPar(void) const
Fetch entire parameter vector from the recording.
size_t GetVecInd(size_t i) const
Fetch a VecAD index from the recording.
size_t NumRes(OpCode op)
Number of variables resulting from the specified operation.
pod_vector< OpCode > op_vec_
The operators in the recording.
static std::vector< std::string > & class_name(void)
List of names for each object in this class.
pod_vector< addr_t > arg_vec_
The operation argument indices in the recording.
atomic_base< Base > * get_user_info(const OpCode op, const addr_t *op_arg, size_t &user_old, size_t &user_m, size_t &user_n) const
unpack extra information corresponding to a UserOp
OpCode
Type used to distinguish different AD< Base > atomic operations.
pod_vector< addr_t > var2op_vec_
Mapping from primary variable index to corresponding operator index. This is used to traverse sub-gra...
Class used to store an operation sequence while it is being recorded (the operation sequence is copie...
void get_op_info(size_t op_index, OpCode &op, const addr_t *&op_arg, size_t &var_index) const
fetch the information corresponding to an operator
void check_inv_op(size_t n_ind)
Check that InvOp operators start with second operator and are contiguous, and there are n_ind of them...
pod_vector< addr_t > op2var_vec_
Index of the result variable for each operator.
size_t size(void) const
current number of elements in this vector.
size_t num_vecad_vec_rec(void) const
Fetch number of VecAD vectors in the recording.
Type * data(void)
current data pointer is no longer valid after any of the following: extend, erase, operator=, and ~pod_vector. Take extreem care when using this function.
pod_vector< char > text_vec_
Character strings ('\0' terminated) in the recording.
void check_dag(void)
Check arguments that are variables, to make sure the have value less than or equal to the previously ...
void swap(pod_vector &other)
Swap all properties of this vector with another.
#define CPPAD_ASSERT_UNKNOWN(exp)
Check that exp is true, if not terminate execution.
void Erase(void)
Erase the recording stored in the player.
size_t num_op_rec(void) const
Fetch number of operators in the recording.
pod_vector< addr_t > vecad_ind_vec_
The VecAD indices in the recording.
size_t num_load_op_rec_
number of vecad load opeations in the reconding
size_t num_text_rec(void) const
Fetch number of characters (representing strings) in the recording.
#define CPPAD_ASSERT_NARG_NRES(op, n_arg, n_res)
Check that operator op has the specified number of of arguments and results.
size_t num_vecad_vec_rec_
Number of VecAD vectors in the recording.
size_t var2op(size_t var_index) const
fetch the operator corresponding to a primary variable
size_t num_op_arg_rec(void) const
Fetch number of argument indices in the recording.
pod_vector< addr_t > op2arg_vec_
index in arg_vec_ corresonding to the first argument for each operator
Base GetPar(size_t i) const
Fetch a parameter from the recording.
OpCode GetOp(size_t i) const
fetch an operator from the recording.
void operator=(const player &play)
Copying an operation sequence from another player to this one.
size_t num_var_rec(void) const
Fetch number of variables in the recording.