Prev Next tape_link

Routines that Link AD<Base> and ADTape<Base> Objects

tape_this
The syntax
     
ptr = x.tape_this()
returns the tape corresponding to x where x and ptr have the prototypes
     const AD<
Base> &x
     ADTape<
Base>  *ptr
The argument x must a variable.

id_handle
The syntax
     
id = AD<Base>::id_handle(thread)
returns a pointer to the currently active tape identifier for the specified OpenMP thread.

thread
The argument thread has prototype
     size_t  
thread
It must be less that CPPAD_MAX_NUM_THREADS and specifies the OpenMP thread that the tape identifier is for. In the case where the preprocessor symbol _OPENMP is not defined, thread must be zero.

id
The return value id has prototype
     size_t *
id
and is a pointer to the tape identifier for the specified thread. The initial value, for the tape identifier is zero. This way it is not equal to the default id_ = 1 value in each AD<Base> object. Either *id_handle(thread) is zero (its initial value) or the current thread number satisfies the equation
     
thread == *id_handle(thread) % CPPAD_MAX_NUM_THREADS
(This is a restriction on how *id_handle(thread) may be changed.)

tape_handle
The syntax
     
tape = AD<Base>::tape_handle(thread)
returns a pointer to a pointer to the current tape for the specified OpenMP thread.

thread
The argument thread has prototype
     size_t  
thread
It must be less that CPPAD_MAX_NUM_THREADS and specifies the OpenMP thread that the tape identifier is for. In the case where the preprocessor symbol _OPENMP is not defined, thread must be zero.

tape
The return value tape has prototype ADTape<Base> **tape. If the tape is currently active,
     *
tape != CPPAD_NULL

tape_new
The syntax
     
id = AD<Base>::tape_new()
creates a new tape and returns the corresponding tape identifier. The resulting tape identifier is not equal to zero, one, or to any of the previous values return by tape_new. In addition, the current thread number is given by
     
thread = id % CPPAD_MAX_NUM_THREADS
The return value id has prototype
     size_t 
id
This function is only called by the user Independent routine and hence usage errors can be reported as coming from that routine.

tape_delete
The syntax
     AD<
Base>::tape_delete(id)
deletes the tape corresponding to the tape identifier id. The value *id_handle(thread) for this thread is set to a value larger than any previous value returned by tape_new().

tape_ptr
The syntax
     
ptr = AD<Base>::tape_ptr()
returns the a pointer to the tape corresponding to the current thread. The corresponding tape is active if and only if ptr == CPPAD_NULL. The syntax
     
ptr = AD<Base>::tape_ptr(id)
does the same thing but if NDEBUG is not defined, it also check that the id is the corresponding tape identifier and that ptr is not equal to CPPAD_NULL. The argument id has prototype
     size_t 
id

Input File: cppad/local/tape_link.hpp