%PDF- %PDF-
Direktori : /proc/thread-self/root/proc/self/root/usr/share/doc/imath-devel/html/functions/ |
Current File : //proc/thread-self/root/proc/self/root/usr/share/doc/imath-devel/html/functions/random.html |
<!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Random Numbers — Imath Documentation</title> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/bizstyle.css" type="text/css" /> <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> <script src="../_static/bizstyle.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Roots" href="roots.html" /> <link rel="prev" title="Matrix Functions" href="matrix.html" /> <meta name="viewport" content="width=device-width,initial-scale=1.0" /> <!--[if lt IE 9]> <script src="_static/css3-mediaqueries.js"></script> <![endif]--> </head><body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="roots.html" title="Roots" accesskey="N">next</a> |</li> <li class="right" > <a href="matrix.html" title="Matrix Functions" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Imath</a> »</li> <li class="nav-item nav-item-this"><a href="">Random Numbers</a></li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="random-numbers"> <span id="random-number-functions"></span><h1>Random Numbers<a class="headerlink" href="#random-numbers" title="Permalink to this headline">¶</a></h1> <p>Functions to compute pseudo-random numbers.</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">#include <Imath/ImathRandom.h></span> </pre></div> </div> <dl class="cpp function"> <dt id="_CPPv4I00EN5Imath15solidSphereRandE3VecR4Rand"> <span id="_CPPv3I00EN5Imath15solidSphereRandER4Rand"></span><span id="_CPPv2I00EN5Imath15solidSphereRandER4Rand"></span>template<class <code class="sig-name descname">Vec</code>, class <code class="sig-name descname">Rand</code>><br /><span class="target" id="_imath_random_8h_1a728165955aab4514228f3dd575989708"></span><a class="reference internal" href="#_CPPv4I00EN5Imath15solidSphereRandE3VecR4Rand" title="Imath::solidSphereRand::Vec">Vec</a> <code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">solidSphereRand</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv4I00EN5Imath15solidSphereRandE3VecR4Rand" title="Imath::solidSphereRand::Rand">Rand</a> &<em>rand</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4I00EN5Imath15solidSphereRandE3VecR4Rand" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return random points uniformly distributed in a sphere with radius 1 around the origin (distance from origin <= 1). </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4I00EN5Imath16hollowSphereRandE3VecR4Rand"> <span id="_CPPv3I00EN5Imath16hollowSphereRandER4Rand"></span><span id="_CPPv2I00EN5Imath16hollowSphereRandER4Rand"></span>template<class <code class="sig-name descname">Vec</code>, class <code class="sig-name descname">Rand</code>><br /><span class="target" id="_imath_random_8h_1a47224d5f3bb441f8189380796c124515"></span><a class="reference internal" href="#_CPPv4I00EN5Imath16hollowSphereRandE3VecR4Rand" title="Imath::hollowSphereRand::Vec">Vec</a> <code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">hollowSphereRand</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv4I00EN5Imath16hollowSphereRandE3VecR4Rand" title="Imath::hollowSphereRand::Rand">Rand</a> &<em>rand</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4I00EN5Imath16hollowSphereRandE3VecR4Rand" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return random points uniformly distributed on the surface of a sphere with radius 1 around the origin. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4I00EN5Imath15gaussSphereRandE3VecR4Rand"> <span id="_CPPv3I00EN5Imath15gaussSphereRandER4Rand"></span><span id="_CPPv2I00EN5Imath15gaussSphereRandER4Rand"></span>template<class <code class="sig-name descname">Vec</code>, class <code class="sig-name descname">Rand</code>><br /><span class="target" id="_imath_random_8h_1acacc168a034c5f7e28a1ba0c2cb2efe6"></span><a class="reference internal" href="#_CPPv4I00EN5Imath15gaussSphereRandE3VecR4Rand" title="Imath::gaussSphereRand::Vec">Vec</a> <code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">gaussSphereRand</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv4I00EN5Imath15gaussSphereRandE3VecR4Rand" title="Imath::gaussSphereRand::Rand">Rand</a> &<em>rand</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4I00EN5Imath15gaussSphereRandE3VecR4Rand" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return random points whose distance from the origin has a normal (Gaussian) distribution with zero mean and unit variance. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4I0EN5Imath9gaussRandEfR4Rand"> <span id="_CPPv3I0EN5Imath9gaussRandER4Rand"></span><span id="_CPPv2I0EN5Imath9gaussRandER4Rand"></span>template<class <code class="sig-name descname">Rand</code>><br /><span class="target" id="_imath_random_8h_1adce42f5564e474038333702a07c0f8c3"></span>float <code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">gaussRand</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv4I0EN5Imath9gaussRandEfR4Rand" title="Imath::gaussRand::Rand">Rand</a> &<em>rand</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4I0EN5Imath9gaussRandEfR4Rand" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return random numbers with a normal (Gaussian) distribution with zero mean and unit variance. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath7erand48EAL3E_t"> <span id="_CPPv3N5Imath7erand48EAL3E_t"></span><span id="_CPPv2N5Imath7erand48EA3_t"></span><span id="Imath::erand48__unsigned-shortA"></span><span class="target" id="_imath_random_8cpp_1a594f35373e91ff6bf458a21945bdfd98"></span>double <code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">erand48</code><span class="sig-paren">(</span>unsigned short <em>state</em>[3]<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N5Imath7erand48EAL3E_t" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Generate double-precision floating-point values between 0.0 and 1.0: </p> <p>The exponent is set to 0x3ff, which indicates a value greater than or equal to 1.0, and less than 2.0. The 48 most significant bits of the significand (mantissa) are filled with pseudo-random bits generated by rand48Next(). The remaining 4 bits are a copy of the 4 most significant bits of the significand. This results in bit patterns between 0x3ff0000000000000 and 0x3fffffffffffffff, which correspond to uniformly distributed floating-point values between 1.0 and 1.99999999999999978. Subtracting 1.0 from those values produces numbers between 0.0 and 0.99999999999999978, that is, between 0.0 and 1.0-DBL_EPSILON. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath7drand48Ev"> <span id="_CPPv3N5Imath7drand48Ev"></span><span id="_CPPv2N5Imath7drand48Ev"></span><span id="Imath::drand48"></span><span class="target" id="_imath_random_8cpp_1ac1b4990880eb2501d8188a227556a961"></span>double <code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">drand48</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N5Imath7drand48Ev" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return erand48() </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath7nrand48EAL3E_t"> <span id="_CPPv3N5Imath7nrand48EAL3E_t"></span><span id="_CPPv2N5Imath7nrand48EA3_t"></span><span id="Imath::nrand48__unsigned-shortA"></span><span class="target" id="_imath_random_8cpp_1af831329f78a9cf9899a7492fe329614e"></span>long int <code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">nrand48</code><span class="sig-paren">(</span>unsigned short <em>state</em>[3]<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N5Imath7nrand48EAL3E_t" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Generate uniformly distributed integers between 0 and 0x7fffffff. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath7lrand48Ev"> <span id="_CPPv3N5Imath7lrand48Ev"></span><span id="_CPPv2N5Imath7lrand48Ev"></span><span id="Imath::lrand48"></span><span class="target" id="_imath_random_8cpp_1ae4c805082320328fb15c35ae9fb33fbe"></span>long int <code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">lrand48</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N5Imath7lrand48Ev" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return nrand48() </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4N5Imath7srand48El"> <span id="_CPPv3N5Imath7srand48El"></span><span id="_CPPv2N5Imath7srand48El"></span><span id="Imath::srand48__l-i"></span><span class="target" id="_imath_random_8cpp_1aa1caeb3c23b570b36e399ef772272502"></span>void <code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">srand48</code><span class="sig-paren">(</span>long int <em>seed</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N5Imath7srand48El" title="Permalink to this definition">¶</a><br /></dt> <dd></dd></dl> </div> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <p class="logo"><a href="../index.html"> <img class="logo" src="../_static/imath-logo-blue.png" alt="Logo"/> </a></p> <h4>Previous topic</h4> <p class="topless"><a href="matrix.html" title="previous chapter">Matrix Functions</a></p> <h4>Next topic</h4> <p class="topless"><a href="roots.html" title="next chapter">Roots</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/functions/random.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" /> <input type="submit" value="Go" /> </form> </div> </div> <script>$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="roots.html" title="Roots" >next</a> |</li> <li class="right" > <a href="matrix.html" title="Matrix Functions" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Imath</a> »</li> <li class="nav-item nav-item-this"><a href="">Random Numbers</a></li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2021, Contributors to the OpenEXR Project. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3. </div> </body> </html>