Files
hustoj/web/cppreference-zh/chmhelp/cpp-numeric-random-negative_binomial_distribution-negative_binomial_distribution.html
2025-08-01 12:57:54 +08:00

92 lines
5.3 KiB
HTML

<!DOCTYPE html>
<html lang="zh" dir="ltr" class="client-nojs" xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh">
<head><meta http-equiv="x-ua-compatible" content="ie=edge">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>std::negative_binomial_distribution&lt;IntType&gt;::negative_binomial_distribution</title>
<link rel="stylesheet" href="ext.css" />
<link rel="stylesheet" href="site_modules.css" />
</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-cpp_numeric_random_negative_binomial_distribution_negative_binomial_distribution skin-cppreference2 action-view cpp-navbar">
<div id="cpp-content-base">
<div id="content"><a id="top"></a>
<h1 id="firstHeading" class="firstHeading"><span style="font-size:0.7em; line-height:130%">std::negative_binomial_distribution&lt;IntType&gt;::</span>negative_binomial_distribution</h1>
<div id="bodyContent">
<div id="contentSub"><span class="subpages">&lt; <a href="cpp.html">cpp</a>&lrm; | <a href="cpp-numeric.html">numeric</a>&lrm; | <a href="cpp-numeric-random.html">random</a>&lrm; | <a href="cpp-numeric-random-negative_binomial_distribution.html">negative binomial distribution</a></span></div>
<div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr" xml:lang="zh">
<table class="t-dcl-begin">
<tbody>
<tr class="t-dcl t-since-cxx11">
<td>
<div><span class="mw-geshi cpp source-cpp">negative_binomial_distribution<span class="br0">(</span><span class="br0">)</span> <span class="sy4">:</span> negative_binomial_distribution<span class="br0">(</span><span class="nu0">1</span><span class="br0">)</span> <span class="br0">{</span><span class="br0">}</span></span></div>
</td>
<td>(1)</td>
<td><span class="t-mark-rev t-since-cxx11">(C++11 &#36215;)</span></td>
</tr>
<tr class="t-dcl t-since-cxx11">
<td>
<div><span class="mw-geshi cpp source-cpp"><span class="kw1">explicit</span> negative_binomial_distribution<span class="br0">(</span> IntType k, <span class="kw4">double</span> p <span class="sy1">=</span> <span class="nu16">0.5</span> <span class="br0">)</span><span class="sy4">;</span></span></div>
</td>
<td>(2)</td>
<td><span class="t-mark-rev t-since-cxx11">(C++11 &#36215;)</span></td>
</tr>
<tr class="t-dcl t-since-cxx11">
<td>
<div><span class="mw-geshi cpp source-cpp"><span class="kw1">explicit</span> negative_binomial_distribution<span class="br0">(</span> <span class="kw4">const</span> param_type<span class="sy3">&amp;</span> params <span class="br0">)</span><span class="sy4">;</span></span></div>
</td>
<td>(3)</td>
<td><span class="t-mark-rev t-since-cxx11">(C++11 &#36215;)</span></td>
</tr>
<tr class="t-dcl-sep">
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>&#26500;&#36896;&#26032;&#30340;&#20998;&#24067;&#23545;&#35937;&#12290; <span class="t-v">(2)</span> &#20197; <code>k</code> &#21644; <code>p</code> &#20026;&#20998;&#24067;&#21442;&#25968;&#65292; <span class="t-v">(3)</span> &#20197; <code>params</code> &#20026;&#20998;&#24067;&#21442;&#25968;&#12290;</p>
<h3><span class="mw-headline" id=".E5.8F.82.E6.95.B0">&#21442;&#25968;</span></h3>
<table class="t-par-begin">
<tr class="t-par">
<td>k</td>
<td>-</td>
<td><i>k</i> &#20998;&#24067;&#21442;&#25968;&#65288;&#35797;&#39564;&#25104;&#21151;&#27425;&#25968;&#65289;</td>
</tr>
<tr class="t-par">
<td>p</td>
<td>-</td>
<td><i>p</i> &#20998;&#24067;&#21442;&#25968;&#65288;&#35797;&#39564;&#29983;&#25104; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw2">true</span></span></span> &#30340;&#27010;&#29575;&#65289;</td>
</tr>
<tr class="t-par">
<td>params</td>
<td>-</td>
<td>&#20998;&#24067;&#21442;&#25968;&#38598;</td>
</tr>
</table>
<h3><span class="mw-headline" id=".E6.B3.A8.E6.84.8F">&#27880;&#24847;</span></h3>
<p>&#35201;&#27714; <span class="texhtml" style="white-space: nowrap;">0 &lt; p &le; 1</span> &#21644; <span class="texhtml" style="white-space: nowrap;">0 &lt; k</span> &#12290;</p>
<p>&#33509; <code>p == 1</code> &#65292;&#21017;&#35843;&#29992;&#19981;&#25509;&#21463; <code>param_type</code> &#21442;&#25968;&#30340; <a href="cpp-numeric-random-negative_binomial_distribution-operator().html"><tt>operator()</tt></a> &#30340;&#37325;&#36733;&#23558;&#23548;&#33268;&#26410;&#23450;&#20041;&#34892;&#20026;&#12290;</p>
<p>&#40664;&#35748;&#26500;&#36896;&#30340; <code>std::negative_binomial_distribution</code> &#31561;&#20215;&#20110;&#40664;&#35748;&#26500;&#36896;&#30340; <span class="t-lc"><a href="cpp-numeric-random-geometric_distribution.html">std::geometric_distribution</a></span> &#12290;</p>
<h3><span class="mw-headline" id=".E7.BC.BA.E9.99.B7.E6.8A.A5.E5.91.8A">&#32570;&#38519;&#25253;&#21578;</span></h3>
<p>&#19979;&#21015;&#26356;&#25913;&#34892;&#20026;&#30340;&#32570;&#38519;&#25253;&#21578;&#36861;&#28335;&#22320;&#24212;&#29992;&#20110;&#20197;&#21069;&#20986;&#29256;&#30340; C++ &#26631;&#20934;&#12290;</p>
<table class="dsctable" style="font-size:0.8em">
<tr>
<th>DR</th>
<th>&#24212;&#29992;&#20110;</th>
<th>&#20986;&#29256;&#26102;&#30340;&#34892;&#20026;</th>
<th>&#27491;&#30830;&#34892;&#20026;</th>
</tr>
<tr>
<td><a rel="nofollow" class="external text" href="https://wg21.link/P0935R0">P0935R0</a></td>
<td>C++11</td>
<td>&#40664;&#35748;&#26500;&#36896;&#20989;&#25968;&#26366;&#20026; explicit</td>
<td>&#20351;&#20043;&#20026;&#38544;&#24335;</td>
</tr>
</table>
</div>
<div class="visualClear"></div>
</div>
</div>
</div>
</body>
</html>