std::binomial_distribution<IntType>::operator()

從 cppreference.com
 
 
 
 
 
template< class Generator >
result_type operator()( Generator& g );
(1) (C++11 起)
template< class Generator >
result_type operator()( Generator& g, const param_type& params );
(2) (C++11 起)

生成根據關聯的概率函數分佈的隨機數。由調用 g.operator() 獲得熵。

第一版本使用關聯的參數集,第二版本用 params。不修改關聯參數集。

[編輯] 參數

g - 均勻隨機位生成器對象
params - 用於替代所關聯分佈參數集的分佈參數集
類型要求
-
Generator 必須滿足均勻隨機位生成器 (UniformRandomBitGenerator)

[編輯] 返回值

生成的隨機數。

[編輯] 複雜度

均攤常數次調用 g.operator()