Prev Next atomic_ctor

@(@\newcommand{\W}[1]{ \; #1 \; } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\B}[1]{ {\bf #1} } \newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} } \newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} } \newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} } \newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }@)@
Atomic Function Constructor

atomic_user afun(ctor_arg_list)


Is a list of arguments for the atomic_user constructor.

The object afun must stay in scope for as long as the corresponding atomic function is used. This includes use by any ADFun<Base> that has this atomic_user operation in its operation sequence .

The user defined atomic_user class is a publicly derived class of atomic_base<Base> . It should be declared as follows:
atomic_user : public CppAD::atomic_base<Base> {
atomic_user(ctor_arg_list) : atomic_base<Base>(namesparsity)
where ... denotes the rest of the implementation of the derived class. This includes completing the constructor and all the virtual functions that have their atomic_base implementations replaced by atomic_user implementations.


The atomic_base constructor cannot be called in parallel mode.

The template parameter determines the Base type for this AD<Base> atomic operation.

This atomic_base constructor argument has the following prototype
     const std::string& 
It is the name for this atomic function and is used for error reporting. The suggested value for name is afun or atomic_user , i.e., the name of the corresponding atomic object or class.

This atomic_base constructor argument has prototype
Base>::option_enum sparsity
The current sparsity for an atomic_base object determines which type of sparsity patterns it uses and its value is one of the following:
sparsity sparsity patterns
atomic_base<Base>::pack_sparsity_enum    vectorBool
atomic_base<Base>::bool_sparsity_enum    vector <bool>
atomic_base<Base>::set_sparsity_enum    vector <std::set<std::size_t> >
There is a default value for sparsity if it is not included in the constructor (which may be either the bool or set option).


Define Constructor
The following is an example of a user atomic function constructor definitions: get_started.cpp .

Use Constructor
The following is an example using a user atomic function constructor: get_started.cpp .
Input File: cppad/core/atomic_base.hpp