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

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

time_det_by_minor_c.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>Determine Amount of Time to Execute det_by_minor</title>
<meta http-equiv='Content-Type' content='text/html' charset='utf-8'/>
<meta name="description" id="description" content="Determine Amount of Time to Execute det_by_minor"/>
<meta name="keywords" id="keywords" content=" determine amount of time to execute det_by_minor syntax purpose time_min source code "/>
<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='_time_det_by_minor_c_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="elapsed_seconds_c.xml" target="_top">Prev</a>
</td><td><a href="main_compare_c.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>Appendix</option>
<option>compare_c</option>
<option>time_det_by_minor_c</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>Appendix-&gt;</option>
<option>Faq</option>
<option>Theory</option>
<option>glossary</option>
<option>Bib</option>
<option>Bugs</option>
<option>WishList</option>
<option>whats_new</option>
<option>deprecated</option>
<option>compare_c</option>
<option>License</option>
</select>
</td>
<td>
<select onchange='choose_down1(this)'>
<option>compare_c-&gt;</option>
<option>det_of_minor_c</option>
<option>det_by_minor_c</option>
<option>uniform_01_c</option>
<option>correct_det_by_minor_c</option>
<option>repeat_det_by_minor_c</option>
<option>elapsed_seconds_c</option>
<option>time_det_by_minor_c</option>
<option>main_compare_c</option>
</select>
</td>
<td>time_det_by_minor_c</td>
<td>
<select onchange='choose_current0(this)'>
<option>Headings-&gt;</option>
<option>Syntax</option>
<option>Purpose</option>
<option>time_min</option>
<option>time</option>
<option>Source Code</option>
</select>
</td>
</tr></table><br/>



<center><b><big><big>Determine Amount of Time to Execute det_by_minor</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'>time</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;time_test(</span></font><i><font color="black"><span style='white-space: nowrap'>size</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>time_min</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/>
reports the amount of wall clock time for <code><font color="blue">det_by_minor</font></code>
to compute the determinant of a square matrix.

The 
<code><i><font color="black"><span style='white-space: nowrap'>size</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;size_t&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>size</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
It specifies the number of rows (and columns) in the square matrix
that the determinant is being calculated for.

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

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;double&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>time_min</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
It specifies the minimum amount of time in seconds
that the 
<code><i><font color="black"><span style='white-space: nowrap'>test</span></font></i></code>
 routine should take.
The calculations is repeated the necessary number of times so that
this amount of execution time (or more) is reached.

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

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;double&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>time</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
and is the number of wall clock seconds that it took for
<code><font color="blue">det_by_minor</font></code> to compute its determinant
(plus overhead which includes choosing a random matrix).




<br/>
<br/>
<b><big><a name="Source Code" id="Source Code">Source Code</a></big></b>

<code><font color='blue'><pre style='display:inline'> 
double time_det_by_minor(size_t size, double time_min)
{	size_t repeat;
	double s0, s1, time;
	repeat = 0;
	s0     = <a href="elapsed_seconds_c.xml" target="_top">elapsed_seconds</a>();
	s1     = s0;
	while( s1 - s0 &lt; time_min )
	{	if( repeat == 0 )
			repeat = 1;
		else	repeat = 2 * repeat;
		s0     = <a href="elapsed_seconds_c.xml" target="_top">elapsed_seconds</a>();
		<a href="elapsed_seconds_c.xml" target="_top">repeat_det_by_minor</a>(repeat, size);
		s1     = <a href="elapsed_seconds_c.xml" target="_top">elapsed_seconds</a>();
	}
	time = (s1 - s0) / (double) repeat;
	return time;
}
</pre></font></code>


<hr/>Input File: compare_c/det_by_minor.c

</body>
</html>