piecewise_linear_distribution::piecewise_linear_distribution
建構散發。
piecewise_linear_distribution();
template<class InIt1, class InIt2>
piecewise_linear_distribution(InIt1 first1, InIt1 last1,
InIt2 first2);
template<class Fn>
piecewise_linear_distribution(size_t count,
double low, double high, Fn func);
explicit piecewise_linear_distribution(const param_type& par0);
參數
first1
處理輸入的 Iterator 的第一個項目位置在發出範圍。last1
處理輸入的 Iterator 最後一個項目的位置會發出範圍。first2
處理輸入的 Iterator 的第一個項目位置在新版本範圍。count
項目數目發出範圍的。low
在發行範圍的最小值。high
在發行範圍的最大值。func
表示發出之物件上的函式。par0
用於參數封裝建構散發。
備註
前置條件:在 stored_p 儲存所有項目為負值,且至少有一個不是零。
第一個建構函式建構儲存值 stored_x 保留值 RealType(0.0) 和 RealType(1.0),,並儲存值 stored_p 保留值 1.0 和 1.0的物件。
第二個建構函式建構儲存值 stored_x 初始化這個序列 [first1, last1)的物件。 stored_p 初始化開始 first2的 stored_x.size() 項目。
第三個建構函式建構儲存值 stored_p 初始化 count 項目的物件。 在項目 I 除以每個範圍 high - low 成員 count subranges,然後儲存 x 的值 func(x) 在子範圍 I之中。 在 stored_x 儲存這些 subranges count + 1 端點。
第四個建構函式會將參數從 par0初始化的物件。
在所有情況下,;如果序列中有兩個以下的項目, stored_x 有兩個項目 RealType(0.0) 和 RealType(1.0),因此, stored_p 具有值 1. 的兩個項目。 此外, stored_p 會正規化,讓所有可能性時間間隔的總和為 1。
需求
標題: <random>
命名空間: std