<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>libstdc++: std::poisson_distribution< _IntType > Class Template Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.4 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">libstdc++</div> </td> </tr> </tbody> </table> </div> </div> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> initNavTree('a00660.html',''); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> | <a href="#pub-types">Public Types</a> | <a href="#pub-methods">Public Member Functions</a> | <a href="#friends">Friends</a> </div> <div class="headertitle"> <div class="title">std::poisson_distribution< _IntType > Class Template Reference<div class="ingroups"><a class="el" href="a01211.html">Poisson Distributions</a></div></div> </div> </div> <div class="contents"> <!-- doxytag: class="std::poisson_distribution" --> <p>A discrete Poisson random number distribution. <a href="a00660.html#details">More...</a></p> <p><a href="a02322.html">List of all members.</a></p> <h2><a name="nested-classes"></a> Classes</h2> <ul> <li>struct <a class="el" href="a00661.html">param_type</a> </ul> <h2><a name="pub-types"></a> Public Types</h2> <ul> <li>typedef _IntType <a class="el" href="a00660.html#a4c3d7ee8432d89d43749cb2c0aa7a588">result_type</a> </ul> <h2><a name="pub-methods"></a> Public Member Functions</h2> <ul> <li><a class="anchor" id="a750b39e44f386dc05574eb60a4044189"></a><!-- doxytag: member="std::poisson_distribution::poisson_distribution" ref="a750b39e44f386dc05574eb60a4044189" args="(double __mean=1.0)" --> <b>poisson_distribution</b> (double __mean=1.0) <li><a class="anchor" id="ae13d9eba8cae94119a0b0a003072fbc2"></a><!-- doxytag: member="std::poisson_distribution::poisson_distribution" ref="ae13d9eba8cae94119a0b0a003072fbc2" args="(const param_type &__p)" --> <b>poisson_distribution</b> (const <a class="el" href="a00661.html">param_type</a> &__p) <li><a class="el" href="a00660.html#a4c3d7ee8432d89d43749cb2c0aa7a588">result_type</a> <a class="el" href="a00660.html#af52804ef9c9e4242cedcd6782169cd78">max</a> () const <li>double <a class="el" href="a00660.html#a239484069ed9b20e5d6949c2c42db989">mean</a> () const <li><a class="el" href="a00660.html#a4c3d7ee8432d89d43749cb2c0aa7a588">result_type</a> <a class="el" href="a00660.html#a5faf76eff45d2171d40deaa8ab3c807e">min</a> () const <li>template<typename _UniformRandomNumberGenerator > <a class="el" href="a00660.html#a4c3d7ee8432d89d43749cb2c0aa7a588">result_type</a> <a class="el" href="a00660.html#ad86771448473d2020de334628ddf6c18">operator()</a> (_UniformRandomNumberGenerator &__urng) <li>template<typename _UniformRandomNumberGenerator > <a class="el" href="a00660.html#a4c3d7ee8432d89d43749cb2c0aa7a588">result_type</a> <a class="el" href="a00660.html#af3d2581282eefd6412d41b50dad2a9a0">operator()</a> (_UniformRandomNumberGenerator &__urng, const <a class="el" href="a00661.html">param_type</a> &__p) <li><a class="el" href="a00661.html">param_type</a> <a class="el" href="a00660.html#af9de79858d221c5e490045740dda9954">param</a> () const <li>void <a class="el" href="a00660.html#ac0233f87c798faa09a5cbeb91969bd8c">param</a> (const <a class="el" href="a00661.html">param_type</a> &__param) <li>void <a class="el" href="a00660.html#a22ecafd7d767621e777f6e8e556ff453">reset</a> () </ul> <h2><a name="friends"></a> Friends</h2> <ul> <li>template<typename _IntType1 , typename _CharT , typename _Traits > <a class="el" href="a00251.html">std::basic_ostream</a>< _CharT, <br class="typebreak"/> _Traits > & <a class="el" href="a00660.html#a615575243ba55d15322e32dfe6fe9e49">operator<<</a> (<a class="el" href="a00251.html">std::basic_ostream</a>< _CharT, _Traits > &, const <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType1 > &) <li>template<typename _IntType1 > bool <a class="el" href="a00660.html#a532b302048bbc253a4ee6687582b1bdb">operator==</a> (const <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType1 > &__d1, const <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType1 > &__d2) <li>template<typename _IntType1 , typename _CharT , typename _Traits > <a class="el" href="a00250.html">std::basic_istream</a>< _CharT, <br class="typebreak"/> _Traits > & <a class="el" href="a00660.html#a821e7d1b6824496fd0625a6323bc25ea">operator>></a> (<a class="el" href="a00250.html">std::basic_istream</a>< _CharT, _Traits > &, <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType1 > &) </ul> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><h3>template<typename _IntType = int><br/> class std::poisson_distribution< _IntType ></h3> <p>A discrete Poisson random number distribution. </p> <p>The formula for the Poisson probability density function is <img class="formulaInl" alt="$p(i|\mu) = \frac{\mu^i}{i!} e^{-\mu}$" src="form_19.png"/> where <img class="formulaInl" alt="$\mu$" src="form_20.png"/> is the parameter of the distribution. </p> <p>Definition at line <a class="el" href="a00997_source.html#l03957">3957</a> of file <a class="el" href="a00997_source.html">random.h</a>.</p> </div><hr/><h2>Member Typedef Documentation</h2> <a class="anchor" id="a4c3d7ee8432d89d43749cb2c0aa7a588"></a><!-- doxytag: member="std::poisson_distribution::result_type" ref="a4c3d7ee8432d89d43749cb2c0aa7a588" args="" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _IntType = int> </div> <table class="memname"> <tr> <td class="memname">typedef _IntType <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType >::<a class="el" href="a00660.html#a4c3d7ee8432d89d43749cb2c0aa7a588">result_type</a></td> </tr> </table> </div> <div class="memdoc"> <p>The type of the range of the distribution. </p> <p>Definition at line <a class="el" href="a00997_source.html#l03964">3964</a> of file <a class="el" href="a00997_source.html">random.h</a>.</p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="af52804ef9c9e4242cedcd6782169cd78"></a><!-- doxytag: member="std::poisson_distribution::max" ref="af52804ef9c9e4242cedcd6782169cd78" args="() const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _IntType = int> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="a00660.html#a4c3d7ee8432d89d43749cb2c0aa7a588">result_type</a> <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType >::max </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the least upper bound value of the distribution. </p> <p>Definition at line <a class="el" href="a00997_source.html#l04051">4051</a> of file <a class="el" href="a00997_source.html">random.h</a>.</p> <p>Referenced by <a class="el" href="a00998_source.html#l01434">std::binomial_distribution< _IntType >::operator()()</a>, and <a class="el" href="a00998_source.html#l01202">std::poisson_distribution< _IntType >::operator()()</a>.</p> </div> </div> <a class="anchor" id="a239484069ed9b20e5d6949c2c42db989"></a><!-- doxytag: member="std::poisson_distribution::mean" ref="a239484069ed9b20e5d6949c2c42db989" args="() const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _IntType = int> </div> <table class="memname"> <tr> <td class="memname">double <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType >::mean </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the distribution parameter <code>mean</code>. </p> <p>Definition at line <a class="el" href="a00997_source.html#l04022">4022</a> of file <a class="el" href="a00997_source.html">random.h</a>.</p> </div> </div> <a class="anchor" id="a5faf76eff45d2171d40deaa8ab3c807e"></a><!-- doxytag: member="std::poisson_distribution::min" ref="a5faf76eff45d2171d40deaa8ab3c807e" args="() const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _IntType = int> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="a00660.html#a4c3d7ee8432d89d43749cb2c0aa7a588">result_type</a> <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType >::min </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the greatest lower bound value of the distribution. </p> <p>Definition at line <a class="el" href="a00997_source.html#l04044">4044</a> of file <a class="el" href="a00997_source.html">random.h</a>.</p> </div> </div> <a class="anchor" id="af3d2581282eefd6412d41b50dad2a9a0"></a><!-- doxytag: member="std::poisson_distribution::operator()" ref="af3d2581282eefd6412d41b50dad2a9a0" args="(_UniformRandomNumberGenerator &__urng, const param_type &__p)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _IntType > </div> <div class="memtemplate"> template<typename _UniformRandomNumberGenerator > </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="a00660.html">poisson_distribution</a>< _IntType >::<a class="el" href="a00660.html#a4c3d7ee8432d89d43749cb2c0aa7a588">result_type</a> <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType >::operator() </td> <td>(</td> <td class="paramtype">_UniformRandomNumberGenerator & </td> <td class="paramname"><em>__urng</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="a00661.html">param_type</a> & </td> <td class="paramname"><em>__param</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>A rejection algorithm when mean >= 12 and a simple method based upon the multiplication of uniform random variates otherwise. NB: The former is available only if _GLIBCXX_USE_C99_MATH_TR1 is defined.</p> <p>Reference: Devroye, L. Non-Uniform Random Variates Generation. Springer-Verlag, New York, 1986, Ch. X, Sects. 3.3 & 3.4 (+ Errata!). </p> <p>Definition at line <a class="el" href="a00998_source.html#l01202">1202</a> of file <a class="el" href="a00998_source.html">random.tcc</a>.</p> <p>References <a class="el" href="a00812_source.html#l00596">std::abs()</a>, <a class="el" href="a00812_source.html#l00784">std::log()</a>, and <a class="el" href="a00997_source.html#l04051">std::poisson_distribution< _IntType >::max()</a>.</p> </div> </div> <a class="anchor" id="ad86771448473d2020de334628ddf6c18"></a><!-- doxytag: member="std::poisson_distribution::operator()" ref="ad86771448473d2020de334628ddf6c18" args="(_UniformRandomNumberGenerator &__urng)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _IntType = int> </div> <div class="memtemplate"> template<typename _UniformRandomNumberGenerator > </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="a00660.html#a4c3d7ee8432d89d43749cb2c0aa7a588">result_type</a> <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType >::operator() </td> <td>(</td> <td class="paramtype">_UniformRandomNumberGenerator & </td> <td class="paramname"><em>__urng</em></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Generating functions. </p> <p>Definition at line <a class="el" href="a00997_source.html#l04059">4059</a> of file <a class="el" href="a00997_source.html">random.h</a>.</p> <p>References <a class="el" href="a00997_source.html#l04059">std::poisson_distribution< _IntType >::operator()()</a>, and <a class="el" href="a00997_source.html#l04029">std::poisson_distribution< _IntType >::param()</a>.</p> <p>Referenced by <a class="el" href="a00997_source.html#l04059">std::poisson_distribution< _IntType >::operator()()</a>.</p> </div> </div> <a class="anchor" id="af9de79858d221c5e490045740dda9954"></a><!-- doxytag: member="std::poisson_distribution::param" ref="af9de79858d221c5e490045740dda9954" args="() const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _IntType = int> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="a00661.html">param_type</a> <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType >::param </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the parameter set of the distribution. </p> <p>Definition at line <a class="el" href="a00997_source.html#l04029">4029</a> of file <a class="el" href="a00997_source.html">random.h</a>.</p> <p>Referenced by <a class="el" href="a00997_source.html#l04059">std::poisson_distribution< _IntType >::operator()()</a>.</p> </div> </div> <a class="anchor" id="ac0233f87c798faa09a5cbeb91969bd8c"></a><!-- doxytag: member="std::poisson_distribution::param" ref="ac0233f87c798faa09a5cbeb91969bd8c" args="(const param_type &__param)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _IntType = int> </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType >::param </td> <td>(</td> <td class="paramtype">const <a class="el" href="a00661.html">param_type</a> & </td> <td class="paramname"><em>__param</em></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Sets the parameter set of the distribution. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">__param</td><td>The new parameter set of the distribution. </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="a00997_source.html#l04037">4037</a> of file <a class="el" href="a00997_source.html">random.h</a>.</p> </div> </div> <a class="anchor" id="a22ecafd7d767621e777f6e8e556ff453"></a><!-- doxytag: member="std::poisson_distribution::reset" ref="a22ecafd7d767621e777f6e8e556ff453" args="()" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _IntType = int> </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType >::reset </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Resets the distribution state. </p> <p>Definition at line <a class="el" href="a00997_source.html#l04015">4015</a> of file <a class="el" href="a00997_source.html">random.h</a>.</p> <p>References <a class="el" href="a00997_source.html#l02031">std::normal_distribution< _RealType >::reset()</a>.</p> </div> </div> <hr/><h2>Friends And Related Function Documentation</h2> <a class="anchor" id="a615575243ba55d15322e32dfe6fe9e49"></a><!-- doxytag: member="std::poisson_distribution::operator<<" ref="a615575243ba55d15322e32dfe6fe9e49" args="(std::basic_ostream< _CharT, _Traits > &, const std::poisson_distribution< _IntType1 > &)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _IntType = int> </div> <div class="memtemplate"> template<typename _IntType1 , typename _CharT , typename _Traits > </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="a00251.html">std::basic_ostream</a><_CharT, _Traits>& operator<< </td> <td>(</td> <td class="paramtype"><a class="el" href="a00251.html">std::basic_ostream</a>< _CharT, _Traits > & </td> <td class="paramname">, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType1 > & </td> <td class="paramname"> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [friend]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Inserts a poisson_distribution random number distribution <code>__x</code> into the output stream <code>__os</code>. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">__os</td><td>An output stream. </td></tr> <tr><td class="paramname">__x</td><td>A poisson_distribution random number distribution.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>The output stream with the state of <code>__x</code> inserted or in an error state. </dd></dl> </div> </div> <a class="anchor" id="a532b302048bbc253a4ee6687582b1bdb"></a><!-- doxytag: member="std::poisson_distribution::operator==" ref="a532b302048bbc253a4ee6687582b1bdb" args="(const std::poisson_distribution< _IntType1 > &__d1, const std::poisson_distribution< _IntType1 > &__d2)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _IntType = int> </div> <div class="memtemplate"> template<typename _IntType1 > </div> <table class="memname"> <tr> <td class="memname">bool operator== </td> <td>(</td> <td class="paramtype">const <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType1 > & </td> <td class="paramname"><em>__d1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType1 > & </td> <td class="paramname"><em>__d2</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [friend]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Return true if two Poisson distributions have the same parameters and the sequences that would be generated are equal. </p> <p>Definition at line <a class="el" href="a00997_source.html#l04074">4074</a> of file <a class="el" href="a00997_source.html">random.h</a>.</p> </div> </div> <a class="anchor" id="a821e7d1b6824496fd0625a6323bc25ea"></a><!-- doxytag: member="std::poisson_distribution::operator>>" ref="a821e7d1b6824496fd0625a6323bc25ea" args="(std::basic_istream< _CharT, _Traits > &, std::poisson_distribution< _IntType1 > &)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _IntType = int> </div> <div class="memtemplate"> template<typename _IntType1 , typename _CharT , typename _Traits > </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="a00250.html">std::basic_istream</a><_CharT, _Traits>& operator>> </td> <td>(</td> <td class="paramtype"><a class="el" href="a00250.html">std::basic_istream</a>< _CharT, _Traits > & </td> <td class="paramname">, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="a00660.html">std::poisson_distribution</a>< _IntType1 > & </td> <td class="paramname"> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [friend]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Extracts a poisson_distribution random number distribution <code>__x</code> from the input stream <code>__is</code>. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">__is</td><td>An input stream. </td></tr> <tr><td class="paramname">__x</td><td>A poisson_distribution random number generator engine.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>The input stream with <code>__x</code> extracted or in an error state. </dd></dl> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="a00997_source.html">random.h</a></li> <li><a class="el" href="a00998_source.html">random.tcc</a></li> </ul> </div> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="a01137.html">std</a> </li> <li class="navelem"><a class="el" href="a00660.html">poisson_distribution</a> </li> <li class="footer">Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </li> </ul> </div> </body> </html>