<?xml version='1.0'?>
<?xml-stylesheet type='text/xsl' href='pmathml.xsl'?>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>AD Copy Constructor and Assignment Operator</title>
<meta name="description" id="description" content="AD Copy Constructor and Assignment Operator"/>
<meta name="keywords" id="keywords" content=" Ad copy assignment constructor convert to Base double Vecad "/>
<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='_ad_copy_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="default.cpp.xml" target="_top">Prev</a>
</td><td><a href="copyad.cpp.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>ad_copy</option>
</select>
</td>
<td>
<select onchange='choose_down2(this)'>
<option>CppAD-&gt;</option>
<option>Install</option>
<option>Introduction</option>
<option>AD</option>
<option>ADFun</option>
<option>multi_thread</option>
<option>library</option>
<option>cppad_ipopt_nlp</option>
<option>Example</option>
<option>preprocessor</option>
<option>Appendix</option>
</select>
</td>
<td>
<select onchange='choose_down1(this)'>
<option>AD-&gt;</option>
<option>Default</option>
<option>ad_copy</option>
<option>Convert</option>
<option>ADValued</option>
<option>BoolValued</option>
<option>VecAD</option>
<option>base_require</option>
</select>
</td>
<td>
<select onchange='choose_down0(this)'>
<option>ad_copy-&gt;</option>
<option>CopyAD.cpp</option>
<option>CopyBase.cpp</option>
<option>Eq.cpp</option>
</select>
</td>
<td>
<select onchange='choose_current0(this)'>
<option>Headings-&gt;</option>
<option>Syntax</option>
<option>---..Constructor</option>
<option>---..Assignment</option>
<option>Purpose</option>
<option>x</option>
<option>y</option>
<option>Example</option>
</select>
</td>
</tr></table><br/>














<center><b><big><big>AD Copy Constructor and Assignment Operator</big></big></b></center>
<br/>
<b><big><a name="Syntax" id="Syntax">Syntax</a></big></b>


<br/>
<br/>
<b><a name="Syntax.Constructor" id="Syntax.Constructor">Constructor</a></b>

<br/>
<code><font color="blue"><span style='white-space: nowrap'>AD&lt;</span></font></code><i><span style='white-space: nowrap'>Base</span></i><code><font color="blue"><span style='white-space: nowrap'>&gt;&#xA0;</span></font></code><i><span style='white-space: nowrap'>y</span></i><code><font color="blue"><span style='white-space: nowrap'>(</span></font></code><i><span style='white-space: nowrap'>x</span></i><code><font color="blue"><span style='white-space: nowrap'>)<br/>
</span></font></code><code><font color="blue"><span style='white-space: nowrap'>AD&lt;</span></font></code><i><span style='white-space: nowrap'>Base</span></i><code><font color="blue"><span style='white-space: nowrap'>&gt;&#xA0;</span></font></code><i><span style='white-space: nowrap'>y</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;</span></font></code><i><span style='white-space: nowrap'>x</span></i>

<br/>
<br/>
<b><a name="Syntax.Assignment" id="Syntax.Assignment">Assignment</a></b>

<br/>
<code><font color="blue"></font></code><i><span style='white-space: nowrap'>y</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;</span></font></code><i><span style='white-space: nowrap'>x</span></i>

<br/>
<br/>
<b><big><a name="Purpose" id="Purpose">Purpose</a></big></b>
<br/>
The constructor creates a new <code><font color="blue"><span style='white-space: nowrap'>AD&lt;</span></font></code><i><span style='white-space: nowrap'>Base</span></i><code><font color="blue"><span style='white-space: nowrap'>&gt;</span></font></code> object <i>y</i> 
and the assignment operator uses an existing <i>y</i>.
In either case, 
<i>y</i> has the same value as <i>x</i>,
and the same dependence on the 
<a href="glossary.xml#Tape.Independent Variable" target="_top"><span style='white-space: nowrap'>independent&#xA0;variables</span></a>

(<i>y</i> is a 
<a href="glossary.xml#Variable" target="_top"><span style='white-space: nowrap'>variable</span></a>
 if and only if <i>x</i> is a variable).

<br/>
<br/>
<b><big><a name="x" id="x">x</a></big></b>
<br/>
The argument <i>x</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;</span></font></code><i><span style='white-space: nowrap'>Type</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>x</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>where <i>Type</i> is
<code><font color="blue"><span style='white-space: nowrap'>VecAD&lt;</span></font></code><i><span style='white-space: nowrap'>Base</span></i><code><font color="blue"><span style='white-space: nowrap'>&gt;::reference</span></font></code>,
<code><font color="blue"><span style='white-space: nowrap'>AD&lt;</span></font></code><i><span style='white-space: nowrap'>Base</span></i><code><font color="blue"><span style='white-space: nowrap'>&gt;</span></font></code>,
<i>Base</i>, or
<code><font color="blue">double</font></code>.

<br/>
<br/>
<b><big><a name="y" id="y">y</a></big></b>
<br/>
The target <i>y</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;AD&lt;</span></font></code><i><span style='white-space: nowrap'>Base</span></i><code><font color="blue"><span style='white-space: nowrap'>&gt;&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>y</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code><br/>
<b><big><a name="Example" id="Example">Example</a></big></b>

<br/>
The following files contain examples and tests of these operations.
Each test returns true if it succeeds and false otherwise.
<table><tr><td align='left'  valign='top'>

<a href="copyad.cpp.xml" target="_top">CopyAD.cpp</a></td><td>
AD Copy Constructor: Example and Test</td></tr>
<tr><td>

<a href="copybase.cpp.xml" target="_top">CopyBase.cpp</a></td><td>
AD Constructor From Base Type: Example and Test</td></tr>
<tr><td>

<a href="eq.cpp.xml" target="_top">Eq.cpp</a></td><td>
AD Assignment Operator: Example and Test</td></tr>
<tr><td>

</td></tr>
</table>

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

</body>
</html>

