名稱空間
變體
操作

std::normal_distribution<RealType>::operator()

來自 cppreference.com
 
 
 
 
std::normal_distribution
成員函式
生成
normal_distribution::operator()
(C++11)
特性
非成員函式
(C++11)(C++11)(直到 C++20)
(C++11)(C++11)
 
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 - 一個均勻隨機位生成器物件
引數列表 - 要使用的分佈引數集,而非關聯的那個
型別要求
-
Generator 必須滿足 UniformRandomBitGenerator 的要求。

[編輯] 返回值

生成的隨機數。

[編輯] 複雜度

均攤常數次 g.operator() 的呼叫。