Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 39da2e642be5eb48375f19991c31eb2c > files > 769

cppad-doc-20100101.4-1.fc14.noarch.rpm

<?xml version='1.0'?>
<?xml-stylesheet type='text/xsl' href='pmathml.xsl'?>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>AD Vectors that Record Index Operations</title>
<meta name="description" id="description" content="AD Vectors that Record Index Operations"/>
<meta name="keywords" id="keywords" content=" Vecad vector Ad index record tape Vecad&lt;base&gt;::reference reference Vecad&lt;base&gt; "/>
<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='_vecad_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="equalopseq.cpp.xml" target="_top">Prev</a>
</td><td><a href="vec_ad.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>VecAD</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>library</option>
<option>Example</option>
<option>configure</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>VecAD-&gt;</option>
<option>vec_ad.cpp</option>
</select>
</td>
<td>
<select onchange='choose_current0(this)'>
<option>Headings-&gt;</option>
<option>Syntax</option>
<option>Purpose</option>
<option>Alternatives</option>
<option>VecAD&lt;Base&gt;::reference</option>
<option>---..Exceptions</option>
<option>Constructor</option>
<option>---..v</option>
<option>n</option>
<option>size</option>
<option>size_t Indexing</option>
<option>---..i</option>
<option>---..b</option>
<option>AD Indexing</option>
<option>---..x</option>
<option>---..r</option>
<option>Example</option>
<option>Speed and Memory</option>
</select>
</td>
</tr></table><br/>









<center><b><big><big>AD Vectors that Record Index Operations</big></big></b></center>
<br/>
<b><big><a name="Syntax" id="Syntax">Syntax</a></big></b>

<br/>
<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;&#xA0;</span></font></code><i><span style='white-space: nowrap'>v</span></i><code><font color="blue"><span style='white-space: nowrap'>(</span></font></code><i><span style='white-space: nowrap'>n</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'>v</span></i><code><font color="blue"><span style='white-space: nowrap'>.size()</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'>&#xA0;=&#xA0;</span></font></code><i><span style='white-space: nowrap'>v</span></i><code><font color="blue"><span style='white-space: nowrap'>[</span></font></code><i><span style='white-space: nowrap'>i</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'>r</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;</span></font></code><i><span style='white-space: nowrap'>v</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'>]</span></font></code>


<br/>
<br/>
<b><big><a name="Purpose" id="Purpose">Purpose</a></big></b>
<br/>
If either <i>v</i> or <i>x</i> is a 
<a href="glossary.xml#Variable" target="_top"><span style='white-space: nowrap'>variable</span></a>
,
the indexing operation
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#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'>v</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>is recorded in the corresponding
AD of <i>Base</i>
<a href="glossary.xml#Operation.Sequence" target="_top"><span style='white-space: nowrap'>operation&#xA0;sequence</span></a>
 and 
transferred to the corresponding <a href="adfun.xml" target="_top"><span style='white-space: nowrap'>ADFun</span></a>
 object <i>f</i>.
Such an index can change each time
zero order <a href="forward.xml" target="_top"><span style='white-space: nowrap'>f.Forward</span></a>
 is used; i.e.,
<i>f</i> is evaluated with new value for the 
<a href="glossary.xml#Tape.Independent Variable" target="_top"><span style='white-space: nowrap'>independent&#xA0;variables</span></a>
. 
Note that the value of <i>y</i> depends on the value of <i>x</i>
in a discrete fashion and CppAD computes its partial derivative with 
respect to <i>x</i> as zero.

<br/>
<br/>
<b><big><a name="Alternatives" id="Alternatives">Alternatives</a></big></b>
<br/>
If only the values in the vector, 
and not the indices, 
depend on the independent variables,
the class <code><font color="blue"></font></code><i><span style='white-space: nowrap'>Vector</span></i><code><font color="blue"><span style='white-space: nowrap'>&lt;&#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;&gt;</span></font></code> is much more efficient for
storing AD values where <i>Vector</i> is any
<a href="simplevector.xml" target="_top"><span style='white-space: nowrap'>SimpleVector</span></a>
 template class, 
If only the indices, 
and not the values in the vector,
depend on the independent variables,
The <a href="discrete.xml" target="_top"><span style='white-space: nowrap'>Discrete</span></a>
 functions are a much more efficient
way to represent these vectors.

<br/>
<br/>
<b><big><a name="VecAD&lt;Base&gt;::reference" id="VecAD&lt;Base&gt;::reference">VecAD&lt;Base&gt;::reference</a></big></b>


<br/>
The result <i>y</i> has type
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;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<br/>
</span></font></code>which is very much like the <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> type 
with some notable exceptions:

<br/>
<br/>
<b><a name="VecAD&lt;Base&gt;::reference.Exceptions" id="VecAD&lt;Base&gt;::reference.Exceptions">Exceptions</a></b>

<ol type="1"><li>
The object <i>y</i> cannot be used with the
<a href="value.xml" target="_top"><span style='white-space: nowrap'>Value</span></a>
 function to compute the corresponding <i>Base</i> value.
If <i>v</i> is not a <a href="glossary.xml#Variable" target="_top"><span style='white-space: nowrap'>variable</span></a>

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;v[</span></font></code><i><span style='white-space: nowrap'>i</span></i><code><font color="blue"><span style='white-space: nowrap'>]<br/>
</span></font></code>can be used to compute the corresponding <i>Base</i> value.

</li><li>

The object <i>y</i> cannot be used
with the <a href="arithmetic.xml" target="_top"><span style='white-space: nowrap'>computed&#xA0;assignments&#xA0;operators</span></a>
 
<code><font color="blue">+=</font></code>, 
<code><font color="blue">-=</font></code>, 
<code><font color="blue">*=</font></code>, or
<code><font color="blue">/=</font></code>.
For example, the following syntax is not valid:
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>v</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'>]&#xA0;+=&#xA0;</span></font></code><i><span style='white-space: nowrap'>z</span></i><code><font color="blue"><span style='white-space: nowrap'>;<br/>
</span></font></code>no matter what the types of <i>z</i>.

</li><li>

Assignment to <i>y</i> returns a <code><font color="blue">void</font></code>.
For example, the following syntax is not valid:
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>z</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;</span></font></code><i><span style='white-space: nowrap'>v</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'>]&#xA0;=&#xA0;</span></font></code><i><span style='white-space: nowrap'>u</span></i><code><font color="blue"><span style='white-space: nowrap'>;<br/>
</span></font></code>no matter what the types of <i>z</i>, and <i>u</i>.

</li><li>

The <a href="condexp.xml" target="_top"><span style='white-space: nowrap'>CondExp</span></a>
 functions do not accept 
<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> arguments.
For example, the following syntax is not valid:
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;CondExpGt(</span></font></code><i><span style='white-space: nowrap'>y</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>z</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>u</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>v</span></i><code><font color="blue"><span style='white-space: nowrap'>)<br/>
</span></font></code>no matter what the types of <i>z</i>, <i>u</i>, and <i>v</i>.

</li><li>

The <a href="parvar.xml" target="_top"><span style='white-space: nowrap'>Parameter&#xA0;and&#xA0;Variable</span></a>
 functions cannot be used with
<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> arguments
(use the entire <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;</span></font></code> vector instead).

</li><li>

The vectors passed to <a href="independent.xml" target="_top"><span style='white-space: nowrap'>Independent</span></a>
 must have elements
of type <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.e., <a href="vecad.xml" target="_top"><span style='white-space: nowrap'>VecAD</span></a>
 vectors
cannot be passed to <code><font color="blue">Independent</font></code>.

</li><li>

If one uses this type in a 
AD of <i>Base</i>
<a href="glossary.xml#Operation.Sequence" target="_top"><span style='white-space: nowrap'>operation&#xA0;sequence</span></a>
,
<a href="glossary.xml#Sparsity Pattern" target="_top"><span style='white-space: nowrap'>sparsity&#xA0;pattern</span></a>
 calculations
(<a href="sparse.xml" target="_top"><span style='white-space: nowrap'>Sparse</span></a>
)
are less efficient because the dependence of different
elements of the vector cannot be separated.

</li></ol>


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


<br/>
<br/>
<b><a name="Constructor.v" id="Constructor.v">v</a></b>
<br/>
The syntax 
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;VecAD&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'>v</span></i><code><font color="blue"><span style='white-space: nowrap'>(</span></font></code><i><span style='white-space: nowrap'>n</span></i><code><font color="blue"><span style='white-space: nowrap'>)<br/>
</span></font></code>creates an <code><font color="blue">VecAD</font></code> object <i>v</i> with 
<i>n</i> elements.
The initial value of the elements of <i>v</i> is unspecified.

<br/>
<br/>
<b><big><a name="n" id="n">n</a></big></b>
<br/>
The argument <i>n</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;size_t&#xA0;</span></font></code><i><span style='white-space: nowrap'>n</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code><br/>
<b><big><a name="size" id="size">size</a></big></b>
<br/>
The syntax
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>v</span></i><code><font color="blue"><span style='white-space: nowrap'>.size()<br/>
</span></font></code>returns the number of elements in the vector <i>v</i>;
i.e., the value of <i>n</i> when it was constructed.

<br/>
<br/>
<b><big><a name="size_t Indexing" id="size_t Indexing">size_t Indexing</a></big></b>
<br/>
We refer to the syntax
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>b</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;</span></font></code><i><span style='white-space: nowrap'>v</span></i><code><font color="blue"><span style='white-space: nowrap'>[</span></font></code><i><span style='white-space: nowrap'>i</span></i><code><font color="blue"><span style='white-space: nowrap'>]<br/>
</span></font></code>as <code><font color="blue">size_t</font></code> indexing of a <code><font color="blue">VecAD</font></code> object.
This indexing is only valid if the vector <i>v</i> is a 
<a href="parvar.xml" target="_top"><span style='white-space: nowrap'>parameter</span></a>
; i.e.,
it does not depend on the independent variables.

<br/>
<br/>
<b><a name="size_t Indexing.i" id="size_t Indexing.i">i</a></b>
<br/>
The operand <i>i</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;size_t&#xA0;</span></font></code><i><span style='white-space: nowrap'>i</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>It must be greater than or equal zero
and less than <i>n</i>; i.e., less than
the number of elements in <i>v</i>. 

<br/>
<br/>
<b><a name="size_t Indexing.b" id="size_t Indexing.b">b</a></b>
<br/>
The result <i>b</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>Base</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;</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>and is a reference to the <i>i</i>-th element in the vector <i>v</i>.
It can be used to change the element value;
for example,
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>v</span></i><code><font color="blue"><span style='white-space: nowrap'>[</span></font></code><i><span style='white-space: nowrap'>i</span></i><code><font color="blue"><span style='white-space: nowrap'>]&#xA0;=&#xA0;</span></font></code><i><span style='white-space: nowrap'>c</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>is valid where <i>c</i> is a <i>Base</i> object.
The reference <i>b</i> is no longer valid once the
destructor for <i>v</i> is called; for example,
when <i>v</i> falls out of scope.

<br/>
<br/>
<b><big><a name="AD Indexing" id="AD Indexing">AD Indexing</a></big></b>
<br/>
We refer to the syntax
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>r</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;</span></font></code><i><span style='white-space: nowrap'>v</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>as AD indexing of a <code><font color="blue">VecAD</font></code> object.

<br/>
<br/>
<b><a name="AD Indexing.x" id="AD Indexing.x">x</a></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;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'>x</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>The value of <i>x</i> must be greater than or equal zero
and less than <i>n</i>; i.e., less than
the number of elements in <i>v</i>. 

<br/>
<br/>
<b><a name="AD Indexing.r" id="AD Indexing.r">r</a></b>
<br/>
The result <i>y</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;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&#xA0;</span></font></code><i><span style='white-space: nowrap'>r</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>The object <i>r</i> has an AD type and its 
operations are recorded as part of the same
AD of <i>Base</i>
<a href="glossary.xml#Operation.Sequence" target="_top"><span style='white-space: nowrap'>operation&#xA0;sequence</span></a>
 as
for <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> objects.
It acts as a reference to the 
element with index 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mrow><mstyle mathvariant='normal'><mi mathvariant='normal'>floor</mi>
</mstyle></mrow>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 in the vector <i>v</i>
(
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mrow><mstyle mathvariant='normal'><mi mathvariant='normal'>floor</mi>
</mstyle></mrow>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 is 
the greatest integer less than or equal <i>x</i>).
Because it is a reference, it can be used to change the element value;
for example,
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>v</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'>]&#xA0;=&#xA0;</span></font></code><i><span style='white-space: nowrap'>z</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>is valid where <i>z</i> is an
<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> object.
As a reference, <i>r</i> is no longer valid once the
destructor for <i>v</i> is called; for example,
when <i>v</i> falls out of scope.

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

<br/>
The file
<a href="vec_ad.cpp.xml" target="_top"><span style='white-space: nowrap'>vec_ad.cpp</span></a>

contains an example and test using <code><font color="blue">VecAD</font></code> vectors.
It returns true if it succeeds and false otherwise.


<br/>
<br/>
<b><big><a name="Speed and Memory" id="Speed and Memory">Speed and Memory</a></big></b>
<br/>
The <a href="vecad.xml" target="_top"><span style='white-space: nowrap'>VecAD</span></a>
 vector type is inefficient because every
time an element of a vector is accessed, a new CppAD 
<a href="glossary.xml#Variable" target="_top"><span style='white-space: nowrap'>variable</span></a>
 is created on the tape
using either the <code><font color="blue">Ldp</font></code> or <code><font color="blue">Ldv</font></code> operation
(unless all of the elements of the vector are
<a href="glossary.xml#Parameter" target="_top"><span style='white-space: nowrap'>parameters</span></a>
).
The effect of this can be seen by executing the following steps:

<ol type="1"><li>
In the file <code><font color="blue">cppad/local/forward_sweep.h</font></code>,
change the definition of <code><font color="blue">CPPAD_FORWARD_SWEEP_TRACE</font></code> to
<code><font color='blue'><pre style='display:inline'> 
	# define CPPAD_FORWARD_SWEEP_TRACE 1
</pre></font></code>

</li><li>

In the <code><font color="blue">Example</font></code> directory, execute the command
<code><font color='blue'><pre style='display:inline'> 
	./OneTest LuVecADOk &quot;lu_vec_ad.cpp -DNDEBUG&quot; &gt; LuVecADOk.log
</pre></font></code>

This will write a trace of all the forward tape operations,
for the test case <a href="luvecadok.cpp.xml" target="_top"><span style='white-space: nowrap'>LuVecADOk.cpp</span></a>
,
to the file <code><font color="blue">LuVecADOk.log</font></code>.
</li><li>

In the <code><font color="blue">Example</font></code> directory execute the commands
<code><font color='blue'><pre style='display:inline'> 
	grep &quot;op=&quot;           LuVecADOk.log | wc -l
	grep &quot;op=Ld[vp]&quot;     LuVecADOk.log | wc -l
	grep &quot;op=St[vp][vp]&quot; LuVecADOk.log | wc -l
</pre></font></code>

The first command counts the number of operators in the tracing,
the second counts the number of VecAD load operations,
and the third counts the number of VecAD store operations.
(For CppAD version 05-11-20 these counts were 956, 348, and 118
respectively.)
</li></ol>



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

</body>
</html>