name, algo, ax, ay, sparsity, optimize
sv = atom_fun.size_var()
Baseis an AD type, it is possible to record
Baseoperations. Note that
algoas an atomic operation while recording
AD<Base>operations, but not while recording
Baseoperations. See the atomic_mul_level.cpp example.
checkpointclass is derived from
atomic_baseand makes this easy. It implements all the
atomic_basevirtual functions and hence its source code
cppad/core/checkpoint.hppprovides an example implementation of atomic_base . The difference is that
checkpoint.hppuses AD instead of user provided derivatives.
checkpoint<Base> atom_fun(name, algo, ax, ay)
AD<Base>operations when the constructor is called.
atom_funmust not be destructed for as long as any
ADFun<Base>object uses its atomic operation.
Basespecifies the base type for AD operations.
ADVectormust be a simple vector class with elements of type
checkpointconstructor argument has prototype
It is the name used for error reporting. The suggested value for
const char* name
atom_fun; i.e., the same name as used for the object being constructed.
and size must be equal to
const ADVector& ax
n. It specifies vector @(@ x \in B^n @)@ at which an
AD<Base>version of @(@ y = f(x) @)@ is to be evaluated.
Its input size must be equal to
mand does not change. The input values of its elements do not matter. Upon return, it is an
AD<Base>version of @(@ y = f(x) @)@.
It specifies sparsity in the
atomic_baseconstructor and must be either
atomic_base<Base>::set_sparsity_enum. This argument is optional and its default value is unspecified.
It specifies if the recording corresponding to the atomic function should be optimized . One expects to use a checkpoint function many times, so it should be worth the time to optimize its operation sequence. For debugging purposes, it may be useful to use the original operation sequence (before optimization) because it corresponds more closely to
algo. This argument is optional and its default value is true.
size_varmember function return value has prototype
It is the size_var for the
ADFun<Base>object is used to store the operation sequence corresponding to
optionsyntax can be used to set the type of sparsity pattern used by
atom_fun. This is an
atomic_base<Base>function and its documentation can be found at atomic_option .
algois arbitrary, except for the fact that the syntax
must evaluate the function @(@ y = f(x) @)@ using
AD<Base>operations. In addition, we assume that the operation sequence does not depend on the value of
axit computes the corresponding value of
ayusing the operation sequence corresponding to
AD<Base>operations are being recorded, it enters the computation as single operation in the recording see start recording . (Currently each use of
atom_funactually corresponds to
m+n+2operations and creates
mnew variables, but this is not part of the CppAD specifications and my change.)
atomic_baseclass holds onto static work space in order to increase speed by avoiding system memory allocation calls. This call makes to work space available to for other uses by the same thread. This should be called when you are done using the user atomic functions for a specific value of
clearroutine cannot be called while in parallel execution mode.