Prev | Next | tape_link |
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 = AD<
Base>::id_handle(
thread)
returns a pointer to the currently active tape identifier
for the specified OpenMP thread.
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.
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 = AD<
Base>::tape_handle(
thread)
returns a pointer to a pointer to the current tape
for the specified OpenMP thread.
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.
ADTape<Base
> **tape.
If the tape is currently active,
*
tape != CPPAD_NULL
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.
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()
.
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