diff options
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a03302.html | 384 |
1 files changed, 384 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a03302.html b/docs/doxygen/nel/a03302.html new file mode 100644 index 00000000..f59c52f9 --- /dev/null +++ b/docs/doxygen/nel/a03302.html @@ -0,0 +1,384 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>NeL: NLMISC::CRandom class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3.6 --> +<div class="qindex"> <form class="search" action="search.php" method="get"> +<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NLMISC::CRandom Class Reference</h1><code>#include <<a class="el" href="a06312.html">random.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A simple, os-independant random generator. <dl compact><dt><b>Author:</b></dt><dd>Nicolas Vizerie <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2002 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a06312.html#l00038">38</a> of file <a class="el" href="a06312.html">random.h</a>.<table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Types</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>enum </td><td class="memItemRight" valign=bottom>{ <a class="el" href="a03302.html#NLMISC_1_1CRandomw0NLMISC_1_1CRandomw1">RandMax</a> = 0x7fff + }</td></tr> + +<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a03302.html#NLMISC_1_1CRandoma0">CRandom</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a03302.html#NLMISC_1_1CRandoma1">frand</a> (double mod=1.0f)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a03302.html#NLMISC_1_1CRandoma2">frandPlusMinus</a> (double mod=1.0)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a10">sint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03302.html#NLMISC_1_1CRandoma3">rand</a> (<a class="el" href="a04558.html#a9">uint16</a> mod)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a10">sint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03302.html#NLMISC_1_1CRandoma4">rand</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a10">sint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03302.html#NLMISC_1_1CRandoma5">randPlusMinus</a> (<a class="el" href="a04558.html#a9">uint16</a> mod)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03302.html#NLMISC_1_1CRandoma6">srand</a> (<a class="el" href="a04558.html#a10">sint32</a> seed)</td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a10">sint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03302.html#NLMISC_1_1CRandomr0">_Seed</a></td></tr> + +</table> +<hr><h2>Member Enumeration Documentation</h2> +<a class="anchor" name="NLMISC_1_1CRandomw0" doxytag="NLMISC::CRandom::@81" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> anonymous enum + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +<dl compact><dt><b>Enumeration values: </b></dt><dd> +<table border=0 cellspacing=2 cellpadding=0> +<tr><td valign=top><em><a class="anchor" name="NLMISC_1_1CRandomw0NLMISC_1_1CRandomw1" doxytag="RandMax" ></a>RandMax</em> </td><td> +</td></tr> +</table> +</dl> + +<p> +Definition at line <a class="el" href="a06312.html#l00042">42</a> of file <a class="el" href="a06312.html">random.h</a>. +<p> +<div class="fragment"><pre>00042 { <a class="code" href="a03302.html#NLMISC_1_1CRandomw0NLMISC_1_1CRandomw1">RandMax</a> = 0x7fff }; +</pre></div> </td> + </tr> +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NLMISC_1_1CRandoma0" doxytag="NLMISC::CRandom::CRandom" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLMISC::CRandom::CRandom </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06312.html#l00064">64</a> of file <a class="el" href="a06312.html">random.h</a>. +<p> +<div class="fragment"><pre>00064 : <a class="code" href="a03302.html#NLMISC_1_1CRandomr0">_Seed</a>(1) +00065 { +00066 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NLMISC_1_1CRandoma1" doxytag="NLMISC::CRandom::frand" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> float NLMISC::CRandom::frand </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">double </td> + <td class="mdname1" valign="top" nowrap> <em>mod</em> = 1.0f </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06312.html#l00090">90</a> of file <a class="el" href="a06312.html">random.h</a>. +<p> +References <a class="el" href="a05646.html#l00993">r</a>, <a class="el" href="a06312.html#l00070">rand()</a>, and <a class="el" href="a03302.html#NLMISC_1_1CRandomw0NLMISC_1_1CRandomw1">RandMax</a>. +<p> +Referenced by <a class="el" href="a06312.html#l00098">frandPlusMinus()</a>. +<p> +<div class="fragment"><pre>00091 { +00092 <span class="keywordtype">double</span> <a class="code" href="a04223.html#a628">r</a> = (<span class="keywordtype">double</span>) <a class="code" href="a03302.html#NLMISC_1_1CRandoma4">rand</a>(); +00093 <a class="code" href="a04223.html#a628">r</a> /= (<span class="keywordtype">double</span>) <a class="code" href="a03302.html#NLMISC_1_1CRandomw0NLMISC_1_1CRandomw1">RandMax</a>; +00094 <span class="keywordflow">return</span> (<span class="keywordtype">float</span>)(<a class="code" href="a04223.html#a628">r</a> * mod); +00095 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CRandoma2" doxytag="NLMISC::CRandom::frandPlusMinus" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> float NLMISC::CRandom::frandPlusMinus </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">double </td> + <td class="mdname1" valign="top" nowrap> <em>mod</em> = 1.0 </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06312.html#l00098">98</a> of file <a class="el" href="a06312.html">random.h</a>. +<p> +References <a class="el" href="a06312.html#l00090">frand()</a>. +<p> +<div class="fragment"><pre>00099 { +00100 <span class="keywordflow">return</span> <a class="code" href="a03302.html#NLMISC_1_1CRandoma1">frand</a>(2*mod)-(<span class="keywordtype">float</span>)mod; +00101 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CRandoma3" doxytag="NLMISC::CRandom::rand" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a10">sint32</a> NLMISC::CRandom::rand </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a9">uint16</a> </td> + <td class="mdname1" valign="top" nowrap> <em>mod</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06312.html#l00076">76</a> of file <a class="el" href="a06312.html">random.h</a>. +<p> +References <a class="el" href="a06312.html#l00070">rand()</a>, <a class="el" href="a03302.html#NLMISC_1_1CRandomw0NLMISC_1_1CRandomw1">RandMax</a>, <a class="el" href="a05981.html#l00099">sint32</a>, and <a class="el" href="a05981.html#l00098">uint16</a>. +<p> +<div class="fragment"><pre>00077 { +00078 <a class="code" href="a04558.html#a10">sint32</a> m=mod; +00079 <span class="keywordflow">return</span> <a class="code" href="a03302.html#NLMISC_1_1CRandoma4">rand</a>()*(m+1)/(<a class="code" href="a05167.html#a12">sint32</a>(RandMax)+1); +00080 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CRandoma4" doxytag="NLMISC::CRandom::rand" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a10">sint32</a> NLMISC::CRandom::rand </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06312.html#l00070">70</a> of file <a class="el" href="a06312.html">random.h</a>. +<p> +References <a class="el" href="a06312.html#l00059">_Seed</a>, <a class="el" href="a03302.html#NLMISC_1_1CRandomw0NLMISC_1_1CRandomw1">RandMax</a>, and <a class="el" href="a05981.html#l00099">sint32</a>. +<p> +Referenced by <a class="el" href="a06768.html#l03767">NL3D::CZoneLighter::attenuation()</a>, <a class="el" href="a06312.html#l00090">frand()</a>, <a class="el" href="a06312.html#l00076">rand()</a>, and <a class="el" href="a06312.html#l00083">randPlusMinus()</a>. +<p> +<div class="fragment"><pre>00071 { +00072 <span class="keywordflow">return</span> ((<a class="code" href="a03302.html#NLMISC_1_1CRandomr0">_Seed</a> = <a class="code" href="a03302.html#NLMISC_1_1CRandomr0">_Seed</a> * 214013L + 2531011L) >> 16) & <a class="code" href="a03302.html#NLMISC_1_1CRandomw0NLMISC_1_1CRandomw1">RandMax</a>; +00073 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CRandoma5" doxytag="NLMISC::CRandom::randPlusMinus" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a10">sint32</a> NLMISC::CRandom::randPlusMinus </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a9">uint16</a> </td> + <td class="mdname1" valign="top" nowrap> <em>mod</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06312.html#l00083">83</a> of file <a class="el" href="a06312.html">random.h</a>. +<p> +References <a class="el" href="a06312.html#l00070">rand()</a>, <a class="el" href="a03302.html#NLMISC_1_1CRandomw0NLMISC_1_1CRandomw1">RandMax</a>, <a class="el" href="a05981.html#l00099">sint32</a>, and <a class="el" href="a05981.html#l00098">uint16</a>. +<p> +<div class="fragment"><pre>00084 { +00085 <a class="code" href="a04558.html#a10">sint32</a> m=mod; +00086 <span class="keywordflow">return</span> m - <a class="code" href="a03302.html#NLMISC_1_1CRandoma4">rand</a>()*(2*m+1)/(<a class="code" href="a05167.html#a12">sint32</a>(RandMax)+1); +00087 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CRandoma6" doxytag="NLMISC::CRandom::srand" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CRandom::srand </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a10">sint32</a> </td> + <td class="mdname1" valign="top" nowrap> <em>seed</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06312.html#l00104">104</a> of file <a class="el" href="a06312.html">random.h</a>. +<p> +References <a class="el" href="a06312.html#l00059">_Seed</a>, and <a class="el" href="a05981.html#l00099">sint32</a>. +<p> +<div class="fragment"><pre>00105 { +00106 <a class="code" href="a03302.html#NLMISC_1_1CRandomr0">_Seed</a> = seed; +00107 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NLMISC_1_1CRandomr0" doxytag="NLMISC::CRandom::_Seed" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a10">sint32</a> <a class="el" href="a03302.html#NLMISC_1_1CRandomr0">NLMISC::CRandom::_Seed</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06312.html#l00059">59</a> of file <a class="el" href="a06312.html">random.h</a>. +<p> +Referenced by <a class="el" href="a06312.html#l00070">rand()</a>, and <a class="el" href="a06312.html#l00104">srand()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="a06312.html">random.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 13:30:58 2004 for NeL by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 > +</a>1.3.6 </small></address> +</body> +</html> |