<?xml version='1.0'?> <?xml-stylesheet type='text/xsl' href='pmathml.xsl'?> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <title>Is an AD Object a Parameter or Variable</title> <meta name="description" id="description" content="Is an AD Object a Parameter or Variable"/> <meta name="keywords" id="keywords" content=" Parameter Variable "/> <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='_parvar_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="boolfun.cpp.xml" target="_top">Prev</a> </td><td><a href="parvar.cpp.xml" target="_top">Next</a> </td><td> <select onchange='choose_across0(this)'> <option>Index-></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-></option> <option>CppAD</option> <option>AD</option> <option>BoolValued</option> <option>ParVar</option> </select> </td> <td> <select onchange='choose_down3(this)'> <option>CppAD-></option> <option>Install</option> <option>Introduction</option> <option>AD</option> <option>ADFun</option> <option>library</option> <option>Example</option> <option>configure</option> <option>Appendix</option> </select> </td> <td> <select onchange='choose_down2(this)'> <option>AD-></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_down1(this)'> <option>BoolValued-></option> <option>Compare</option> <option>NearEqualExt</option> <option>BoolFun</option> <option>ParVar</option> <option>EqualOpSeq</option> </select> </td> <td> <select onchange='choose_down0(this)'> <option>ParVar-></option> <option>ParVar.cpp</option> </select> </td> <td> <select onchange='choose_current0(this)'> <option>Headings-></option> <option>Syntax</option> <option>Purpose</option> <option>x</option> <option>b</option> <option>Operation Sequence</option> <option>Example</option> </select> </td> </tr></table><br/> <center><b><big><big>Is an AD Object a Parameter or Variable</big></big></b></center> <br/> <b><big><a name="Syntax" id="Syntax">Syntax</a></big></b> <br/> <code><font color="blue"></font></code><i><span style='white-space: nowrap'>b</span></i><code><font color="blue"><span style='white-space: nowrap'> = Parameter(</span></font></code><i><span style='white-space: nowrap'>x</span></i><code><font color="blue"><span style='white-space: nowrap'>)</span></font></code> <code><span style='white-space: nowrap'><br/> </span></code><code><font color="blue"></font></code><i><span style='white-space: nowrap'>b</span></i><code><font color="blue"><span style='white-space: nowrap'> = Variable(</span></font></code><i><span style='white-space: nowrap'>x</span></i><code><font color="blue"><span style='white-space: nowrap'>)</span></font></code> <br/> <br/> <b><big><a name="Purpose" id="Purpose">Purpose</a></big></b> <br/> Determine if <i>x</i> is a <a href="glossary.xml#Parameter" target="_top"><span style='white-space: nowrap'>parameter</span></a> or <a href="glossary.xml#Variable" target="_top"><span style='white-space: nowrap'>variable</span></a> . <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/>      const AD<</span></font></code><i><span style='white-space: nowrap'>Base</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/>      const VecAD<</span></font></code><i><span style='white-space: nowrap'>Base</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><br/> <b><big><a name="b" id="b">b</a></big></b> <br/> The return value <i>b</i> has prototype <code><font color="blue"><span style='white-space: nowrap'><br/>      bool </span></font></code><i><span style='white-space: nowrap'>b</span></i><code><font color="blue"><span style='white-space: nowrap'><br/> </span></font></code>The return value for <code><font color="blue">Parameter</font></code> (<code><font color="blue">Variable</font></code>) is true if and only if <i>x</i> is a parameter (variable). Note that a <a href="vecad.xml" target="_top"><span style='white-space: nowrap'>VecAD<Base></span></a> object is a variable if any element of the vector depends on the independent variables. <br/> <br/> <b><big><a name="Operation Sequence" id="Operation Sequence">Operation Sequence</a></big></b> <br/> The result of this operation is not an <a href="glossary.xml#AD of Base" target="_top"><span style='white-space: nowrap'>AD of Base</span></a> object. Thus it will not be recorded as part of an AD of <i>Base</i> <a href="glossary.xml#Operation.Sequence" target="_top"><span style='white-space: nowrap'>operation sequence</span></a> . <br/> <br/> <b><big><a name="Example" id="Example">Example</a></big></b> <br/> The file <a href="parvar.cpp.xml" target="_top"><span style='white-space: nowrap'>ParVar.cpp</span></a> contains an example and test of these functions. It returns true if it succeeds and false otherwise. <hr/>Input File: cppad/local/par_var.hpp </body> </html>