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

128 lines
7.1 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::piecewise_linear_distribution&lt;RealType&gt;::piecewise_linear_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_piecewise_linear_distribution_piecewise_linear_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::piecewise_linear_distribution&lt;RealType&gt;::</span>piecewise_linear_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-piecewise_linear_distribution.html">piecewise linear 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">piecewise_linear_distribution<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</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">template</span><span class="sy1">&lt;</span> <span class="kw1">class</span> InputIt1, <span class="kw1">class</span> InputIt2 <span class="sy1">&gt;</span><br /></span>
<p>piecewise_linear_distribution<span class="br0">(</span> InputIt1 first_i, InputIt1 last_i,<br /></p>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InputIt2 first_w <span class="br0">)</span><span class="sy4">;</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">template</span><span class="sy1">&lt;</span> <span class="kw1">class</span> UnaryOperation <span class="sy1">&gt;</span><br /></span>
<p>piecewise_linear_distribution<span class="br0">(</span> <a href="cpp-utility-initializer_list.html"><span class="kw960">std::<span class="me2">initializer_list</span></span></a><span class="sy1">&lt;</span>RealType<span class="sy1">&gt;</span> ilist,<br /></p>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UnaryOperation fw <span class="br0">)</span><span class="sy4">;</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 t-since-cxx11">
<td>
<div><span class="mw-geshi cpp source-cpp"><span class="kw1">template</span><span class="sy1">&lt;</span> <span class="kw1">class</span> UnaryOperation <span class="sy1">&gt;</span><br /></span>
<p>piecewise_linear_distribution<span class="br0">(</span> <a href="cpp-types-size_t.html"><span class="kw100">std::<span class="me2">size_t</span></span></a> nw,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RealType xmin, RealType xmax,<br /></p>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UnaryOperation fw <span class="br0">)</span><span class="sy4">;</span></div>
</td>
<td>(4)</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> piecewise_linear_distribution<span class="br0">(</span> <span class="kw4">const</span> param_type<span class="sy3">&amp;</span> parm <span class="br0">)</span><span class="sy4">;</span></span></div>
</td>
<td>(5)</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; piecewise_linear_distribution &#23545;&#35937;&#12290;</p>
<div class="t-li1"><span class="t-li">1)</span> &#26500;&#36896;&#20998;&#24067;&#23545;&#35937;&#65292;&#26377; <i>n</i> = 1 &#12289; <i>&rho;0</i> = 1 &#12289; <i>b0</i> = 0 &#19988; <i>b1</i> = 1 &#12290;</div>
<div class="t-li1"><span class="t-li">2)</span> &#20174;&#21306;&#38388;&#24207;&#21015; <code>[first_i, last_i)</code> &#19978;&#30340;&#36845;&#20195;&#22120;&#21644;&#22987;&#20110; <code>first_w</code> &#30340;&#21305;&#37197;&#26435;&#37325;&#24207;&#21015;&#26500;&#36896;&#20998;&#24067;&#23545;&#35937;&#12290;</div>
<div class="t-li1"><span class="t-li">3)</span> &#26500;&#36896;&#20998;&#24067;&#23545;&#35937;&#65292;&#20854;&#20013;&#21306;&#38388;&#21462;&#33258; initializer_list <code>ilist</code> &#65292;&#32780;&#26435;&#37325;&#20197;&#20989;&#25968; <code>fw</code> &#35745;&#31639;&#12290;</div>
<div class="t-li1"><span class="t-li">4)</span> &#26500;&#36896;&#20998;&#24067;&#23545;&#35937;&#65292;&#25317;&#26377;&#22312; <code>[xmin, xmax]</code> &#19978;&#22343;&#21248;&#20998;&#24067;&#30340; <code>nw</code> &#20010;&#21306;&#38388;&#12290;</div>
<div class="t-li1"><span class="t-li">5)</span> &#26500;&#36896;&#20197;&#21442;&#25968; <code>param</code> &#21021;&#22987;&#21270;&#30340;&#23545;&#35937;&#12290;</div>
<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>first_i</td>
<td>-</td>
<td>&#21021;&#22987;&#21270;&#20026;&#25351;&#21521;&#21306;&#38388;&#24207;&#21015;&#36215;&#22987;&#30340;&#36845;&#20195;&#22120;</td>
</tr>
<tr class="t-par">
<td>last_i</td>
<td>-</td>
<td>&#21021;&#22987;&#21270;&#20026;&#25351;&#21521;&#21306;&#38388;&#24207;&#21015;&#26411;&#23614;&#23614;&#21518;&#19968;&#20301;&#32622;&#30340;&#36845;&#20195;&#22120;</td>
</tr>
<tr class="t-par">
<td>first_w</td>
<td>-</td>
<td>&#21021;&#22987;&#21270;&#20026;&#25351;&#21521;&#23494;&#24230;&#65288;&#26435;&#37325;&#65289;&#24207;&#21015;&#36215;&#22987;&#30340;&#36845;&#20195;&#22120;</td>
</tr>
<tr class="t-par">
<td>ilist_i</td>
<td>-</td>
<td>&#20135;&#20986;&#21306;&#38388;&#24207;&#21015;&#30340; initializer_list</td>
</tr>
<tr class="t-par">
<td>fw</td>
<td>-</td>
<td>&#20135;&#20986;&#23494;&#24230;&#30340; double(double) &#20989;&#25968;</td>
</tr>
<tr class="t-par">
<td>nw</td>
<td>-</td>
<td>&#23494;&#24230;&#25968;&#37327;</td>
</tr>
<tr class="t-par">
<td>xmin</td>
<td>-</td>
<td>&#21306;&#38388;&#24207;&#21015;&#19979;&#30028;</td>
</tr>
<tr class="t-par">
<td>xmax</td>
<td>-</td>
<td>&#21306;&#38388;&#24207;&#21015;&#19978;&#30028;</td>
</tr>
<tr class="t-par">
<td>parm</td>
<td>-</td>
<td>&#20998;&#24067;&#21442;&#25968;&#38598;</td>
</tr>
</table>
</div>
<div class="visualClear"></div>
</div>
</div>
</div>
</body>
</html>