<?xml version='1.0'?>
<html xmlns='http://www.w3.org/1999/xhtml'
      xmlns:math='http://www.w3.org/1998/Math/MathML'
>
<head>
<title>Atomic Function Constructor</title>
<meta name="description" id="description" content="Atomic Function Constructor"/>
<meta name="keywords" id="keywords" content=" constructor atomic function "/>
<style type='text/css'>
body { color : black }
body { background-color : white }
A:link { color : blue }
A:visited { color : purple }
A:active { color : purple }
</style>
<script type='text/javascript' language='JavaScript' src='_atomic_ctor_xml.js'>
</script>
</head>
<body>
<table><tr>
<td>
<a href="http://www.coin-or.org/CppAD/" target="_top"><img border="0" src="_image.gif"/></a>
</td>
<td><a href="atomic_base.xml" target="_top">Prev</a>
</td><td><a href="atomic_option.xml" target="_top">Next</a>
</td><td>
<select onchange='choose_across0(this)'>
<option>Index-&gt;</option>
<option>contents</option>
<option>reference</option>
<option>index</option>
<option>search</option>
<option>external</option>
</select>
</td>
<td>
<select onchange='choose_up0(this)'>
<option>Up-&gt;</option>
<option>CppAD</option>
<option>AD</option>
<option>ADValued</option>
<option>atomic</option>
<option>atomic_base</option>
<option>atomic_ctor</option>
</select>
</td>
<td>
<select onchange='choose_down3(this)'>
<option>ADValued-&gt;</option>
<option>Arithmetic</option>
<option>std_math_ad</option>
<option>MathOther</option>
<option>CondExp</option>
<option>Discrete</option>
<option>atomic</option>
</select>
</td>
<td>
<select onchange='choose_down2(this)'>
<option>atomic-&gt;</option>
<option>checkpoint</option>
<option>atomic_base</option>
</select>
</td>
<td>
<select onchange='choose_down1(this)'>
<option>atomic_base-&gt;</option>
<option>atomic_ctor</option>
<option>atomic_option</option>
<option>atomic_afun</option>
<option>atomic_forward</option>
<option>atomic_reverse</option>
<option>atomic_for_sparse_jac</option>
<option>atomic_rev_sparse_jac</option>
<option>atomic_rev_sparse_hes</option>
<option>atomic_base_clear</option>
<option>atomic_get_started.cpp</option>
<option>atomic_norm_sq.cpp</option>
<option>atomic_reciprocal.cpp</option>
<option>atomic_tangent.cpp</option>
<option>atomic_mat_mul.cpp</option>
</select>
</td>
<td>atomic_ctor</td>
<td>
<select onchange='choose_current0(this)'>
<option>Headings-&gt;</option>
<option>Syntax</option>
<option>atomic_user</option>
<option>---..ctor_arg_list</option>
<option>---..afun</option>
<option>---..Implementation</option>
<option>atomic_base</option>
<option>---..Restrictions</option>
<option>---..Base</option>
<option>---..name</option>
<option>Examples</option>
<option>---..Define Constructor</option>
<option>---..Use Constructor</option>
</select>
</td>
</tr></table><br/>



<center><b><big><big>Atomic Function Constructor</big></big></b></center>
<br/>
<b><big><a name="Syntax" id="Syntax">Syntax</a></big></b>

<br/>

<code><i><font color="black"><span style='white-space: nowrap'>atomic_user&#xA0;afun</span></font></i><font color="blue"><span style='white-space: nowrap'>(</span></font><i><font color="black"><span style='white-space: nowrap'>ctor_arg_list</span></font></i><font color="blue"><span style='white-space: nowrap'>)<br/>
</span></font></code>

<code><font color="blue"><span style='white-space: nowrap'>atomic_base&lt;</span></font><i><font color="black"><span style='white-space: nowrap'>Base</span></font></i><font color="blue"><span style='white-space: nowrap'>&gt;(</span></font><i><font color="black"><span style='white-space: nowrap'>name</span></font></i><font color="blue"><span style='white-space: nowrap'>)<br/>
</span></font></code>
<br/>
<b><big><a name="atomic_user" id="atomic_user">atomic_user</a></big></b>


<br/>
<br/>
<b><a name="atomic_user.ctor_arg_list" id="atomic_user.ctor_arg_list">ctor_arg_list</a></b>
<br/>
Is a list of arguments for the 
<code><i><font color="black"><span style='white-space: nowrap'>atomic_user</span></font></i></code>
 constructor.

<br/>
<br/>
<b><a name="atomic_user.afun" id="atomic_user.afun">afun</a></b>
<br/>
The object 
<code><i><font color="black"><span style='white-space: nowrap'>afun</span></font></i></code>
 must stay in scope for as long
as the corresponding atomic function is used.
This includes use by any <a href="adfun.xml" target="_top"><span style='white-space: nowrap'>ADFun&lt;Base&gt;</span></a>
 that 
has this 
<code><i><font color="black"><span style='white-space: nowrap'>atomic_user</span></font></i></code>
 operation in its 
<a href="glossary.xml#Operation.Sequence" target="_top"><span style='white-space: nowrap'>operation&#xA0;sequence</span></a>
.

<br/>
<br/>
<b><a name="atomic_user.Implementation" id="atomic_user.Implementation">Implementation</a></b>
<br/>
The user defined 
<code><i><font color="black"><span style='white-space: nowrap'>atomic_user</span></font></i></code>
 class is a publicly derived class of 

<code><font color="blue"><span style='white-space: nowrap'>atomic_base&lt;</span></font><i><font color="black"><span style='white-space: nowrap'>Base</span></font></i><font color="blue"><span style='white-space: nowrap'>&gt;</span></font></code>
.
It should be declared as follows:

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;class&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>atomic_user</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;:&#xA0;public&#xA0;CppAD::atomic_base&lt;</span></font><i><font color="black"><span style='white-space: nowrap'>Base</span></font></i><font color="blue"><span style='white-space: nowrap'>&gt;&#xA0;{<br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;public:<br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>atomic_user</span></font></i><font color="blue"><span style='white-space: nowrap'>(</span></font><i><font color="black"><span style='white-space: nowrap'>ctor_arg_list</span></font></i><font color="blue"><span style='white-space: nowrap'>)&#xA0;:&#xA0;atomic_base&lt;</span></font><i><font color="black"><span style='white-space: nowrap'>Base</span></font></i><font color="blue"><span style='white-space: nowrap'>&gt;(</span></font><i><font color="black"><span style='white-space: nowrap'>name</span></font></i><font color="blue"><span style='white-space: nowrap'>)<br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>...</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;};<br/>
</span></font></code>
where 
<code><i><font color="black"><span style='white-space: nowrap'>...</span></font></i></code>
  
denotes the rest of the implementation of the derived class.
This includes completing the constructor and
all the virtual functions that have their 
<code><font color="blue">atomic_base</font></code> implementations replaced by 

<code><i><font color="black"><span style='white-space: nowrap'>atomic_user</span></font></i></code>
 implementations.

<br/>
<br/>
<b><big><a name="atomic_base" id="atomic_base">atomic_base</a></big></b>


<br/>
<br/>
<b><a name="atomic_base.Restrictions" id="atomic_base.Restrictions">Restrictions</a></b>
<br/>
The <code><font color="blue">atomic_base</font></code> constructor cannot be called in
<a href="ta_in_parallel.xml" target="_top"><span style='white-space: nowrap'>parallel</span></a>
 mode.

<br/>
<br/>
<b><a name="atomic_base.Base" id="atomic_base.Base">Base</a></b>
<br/>
The template parameter determines the

<code><i><font color="black"><span style='white-space: nowrap'>Base</span></font></i></code>
 type for this 
<code><font color="blue"><span style='white-space: nowrap'>AD&lt;</span></font><i><font color="black"><span style='white-space: nowrap'>Base</span></font></i><font color="blue"><span style='white-space: nowrap'>&gt;</span></font></code>
 atomic operation.

<br/>
<br/>
<b><a name="atomic_base.name" id="atomic_base.name">name</a></b>
<br/>
This 
<code><i><font color="black"><span style='white-space: nowrap'>atomic_base</span></font></i></code>
 constructor argument has either of the
following prototypes

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;char*&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>name</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;std::string&amp;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>name</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
It is the name for this atomic function and is used for error reporting.
The suggested value for 
<code><i><font color="black"><span style='white-space: nowrap'>name</span></font></i></code>
 is 
<code><i><font color="black"><span style='white-space: nowrap'>afun</span></font></i></code>
 or 
<code><i><font color="black"><span style='white-space: nowrap'>atomic_user</span></font></i></code>
,
i.e., the name of the corresponding atomic object or class.

<br/>
<br/>
<b><big><a name="Examples" id="Examples">Examples</a></big></b>


<br/>
<br/>
<b><a name="Examples.Define Constructor" id="Examples.Define Constructor">Define Constructor</a></b>
<br/>
The following are links to user atomic function constructor definitions:
<a href="atomic_get_started.cpp.xml#Constructor" target="_top"><span style='white-space: nowrap'>get_started.cpp</span></a>
,
<a href="atomic_norm_sq.cpp.xml#Constructor" target="_top"><span style='white-space: nowrap'>norm_sq.cpp</span></a>
,
<a href="atomic_reciprocal.cpp.xml#Constructor" target="_top"><span style='white-space: nowrap'>reciprocal.cpp</span></a>
,
<a href="atomic_tangent.cpp.xml#Constructor" target="_top"><span style='white-space: nowrap'>tangent.cpp</span></a>
,
<a href="atomic_matrix_mul.hpp.xml#Constructor" target="_top"><span style='white-space: nowrap'>matrix_mul.hpp</span></a>
.

<br/>
<br/>
<b><a name="Examples.Use Constructor" id="Examples.Use Constructor">Use Constructor</a></b>
<br/>
The following are links to user atomic function constructor uses:
<a href="atomic_get_started.cpp.xml#Use Atomic Function.Constructor" target="_top"><span style='white-space: nowrap'>get_started.cpp</span></a>
,
<a href="atomic_norm_sq.cpp.xml#Use Atomic Function.Constructor" target="_top"><span style='white-space: nowrap'>norm_sq.cpp</span></a>
,
<a href="atomic_reciprocal.cpp.xml#Use Atomic Function.Constructor" target="_top"><span style='white-space: nowrap'>reciprocal.cpp</span></a>
,
<a href="atomic_tangent.cpp.xml#Use Atomic Function.Constructor" target="_top"><span style='white-space: nowrap'>tangent.cpp</span></a>
,
<a href="atomic_mat_mul.cpp.xml#Use Atomic Function.Constructor" target="_top"><span style='white-space: nowrap'>mat_mul.cpp</span></a>
.



<hr/>Input File: cppad/local/atomic_base.hpp

</body>
</html>
