Codebase list cppad / upstream/2015.00.00.7 doc / ta_delete_array.xml
upstream/2015.00.00.7

Tree @upstream/2015.00.00.7 (Download .tar.gz)

ta_delete_array.xml @upstream/2015.00.00.7raw · history · blame

<?xml version='1.0'?>
<html xmlns='http://www.w3.org/1999/xhtml'
      xmlns:math='http://www.w3.org/1998/Math/MathML'
>
<head>
<title>Deallocate An Array and Call Destructor for its Elements</title>
<meta http-equiv='Content-Type' content='text/html' charset='utf-8'/>
<meta name="description" id="description" content="Deallocate An Array and Call Destructor for its Elements"/>
<meta name="keywords" id="keywords" content=" deallocate an array and call destructor for its elements delete_array thread_alloc allocate syntax purpose type thread delta example "/>
<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='_ta_delete_array_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="ta_create_array.xml" target="_top">Prev</a>
</td><td><a href="ta_free_all.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>library</option>
<option>thread_alloc</option>
<option>ta_delete_array</option>
</select>
</td>
<td>
<select onchange='choose_down3(this)'>
<option>CppAD-&gt;</option>
<option>Install</option>
<option>Introduction</option>
<option>AD</option>
<option>ADFun</option>
<option>preprocessor</option>
<option>multi_thread</option>
<option>library</option>
<option>ipopt_solve</option>
<option>Example</option>
<option>speed</option>
<option>Appendix</option>
</select>
</td>
<td>
<select onchange='choose_down2(this)'>
<option>library-&gt;</option>
<option>ErrorHandler</option>
<option>NearEqual</option>
<option>speed_test</option>
<option>SpeedTest</option>
<option>time_test</option>
<option>NumericType</option>
<option>CheckNumericType</option>
<option>SimpleVector</option>
<option>CheckSimpleVector</option>
<option>nan</option>
<option>pow_int</option>
<option>Poly</option>
<option>LuDetAndSolve</option>
<option>RombergOne</option>
<option>RombergMul</option>
<option>Runge45</option>
<option>Rosen34</option>
<option>OdeErrControl</option>
<option>OdeGear</option>
<option>OdeGearControl</option>
<option>CppAD_vector</option>
<option>thread_alloc</option>
<option>index_sort</option>
<option>BenderQuad</option>
<option>opt_val_hes</option>
<option>LuRatio</option>
</select>
</td>
<td>
<select onchange='choose_down1(this)'>
<option>thread_alloc-&gt;</option>
<option>thread_alloc.cpp</option>
<option>ta_parallel_setup</option>
<option>ta_num_threads</option>
<option>ta_in_parallel</option>
<option>ta_thread_num</option>
<option>ta_get_memory</option>
<option>ta_return_memory</option>
<option>ta_free_available</option>
<option>ta_hold_memory</option>
<option>ta_inuse</option>
<option>ta_available</option>
<option>ta_create_array</option>
<option>ta_delete_array</option>
<option>ta_free_all</option>
</select>
</td>
<td>ta_delete_array</td>
<td>
<select onchange='choose_current0(this)'>
<option>Headings-&gt;</option>
<option>Syntax</option>
<option>Purpose</option>
<option>Type</option>
<option>array</option>
<option>Thread</option>
<option>Delta</option>
<option>Example</option>
</select>
</td>
</tr></table><br/>



<center><b><big><big>Deallocate An Array and Call Destructor for its Elements</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'>thread_alloc::delete_array(</span></font><i><font color="black"><span style='white-space: nowrap'>array</span></font></i><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/>
Returns memory corresponding to an array created by 
(create by <a href="ta_create_array.xml" target="_top"><span style='white-space: nowrap'>create_array</span></a>
) to the 
<a href="ta_available.xml" target="_top"><span style='white-space: nowrap'>available</span></a>
 memory pool for the current thread.

<br/>
<br/>
<b><big><a name="Type" id="Type">Type</a></big></b>
<br/>
The type of the elements of the array.

<br/>
<br/>
<b><big><a name="array" id="array">array</a></big></b>
<br/>
The argument 
<code><i><font color="black"><span style='white-space: nowrap'>array</span></font></i></code>
 has prototype

<code><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'>Type</span></font></i><font color="blue"><span style='white-space: nowrap'>*&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>array</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
It is a value returned by <a href="ta_create_array.xml" target="_top"><span style='white-space: nowrap'>create_array</span></a>
 and not yet deleted.
The 
<code><i><font color="black"><span style='white-space: nowrap'>Type</span></font></i></code>
 destructor is called for each element in the array.

<br/>
<br/>
<b><big><a name="Thread" id="Thread">Thread</a></big></b>
<br/>
The <a href="ta_thread_num.xml" target="_top"><span style='white-space: nowrap'>current&#xA0;thread</span></a>
 must be the
same as when <a href="ta_create_array.xml" target="_top"><span style='white-space: nowrap'>create_array</span></a>
 returned the value 
<code><i><font color="black"><span style='white-space: nowrap'>array</span></font></i></code>
.
There is an exception to this rule:
when the current execution mode is sequential
(not <a href="ta_in_parallel.xml" target="_top"><span style='white-space: nowrap'>parallel</span></a>
) the current thread number does not matter.

<br/>
<br/>
<b><big><a name="Delta" id="Delta">Delta</a></big></b>
<br/>
The amount of memory <a href="ta_inuse.xml" target="_top"><span style='white-space: nowrap'>inuse</span></a>
 will decrease by 
<code><i><font color="black"><span style='white-space: nowrap'>delta</span></font></i></code>
,
and the <a href="ta_available.xml" target="_top"><span style='white-space: nowrap'>available</span></a>
 memory will increase by 
<code><i><font color="black"><span style='white-space: nowrap'>delta</span></font></i></code>
,
where <a href="ta_create_array.xml#Delta" target="_top"><span style='white-space: nowrap'>delta</span></a>
 
is the same as for the corresponding call to <code><font color="blue">create_array</font></code>.

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

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



<hr/>Input File: cppad/thread_alloc.hpp

</body>
</html>