名前空間
変種
操作

std::discrete_distribution::discrete_distribution

提供: cppreference.com

 
 
ニューメリックスライブラリ
一般的な数学関数
浮動小数点環境
複素数
数値配列
擬似乱数生成
コンパイル時有理数演算 (C++11)
汎用の数値演算
Original:
Generic numeric operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iota(C++11)
accumulate
inner_product
adjacent_difference
partial_sum
 
擬似乱数生成
エンジンとエンジンアダプタ
Original:
Engines and engine adaptors
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
linear_congruential_engine(C++11)
mersenne_twister_engine(C++11)
subtract_with_carry_engine(C++11)
discard_block_engine(C++11)
independent_bits_engine(C++11)
shuffle_order_engine(C++11)
ジェネレータ
Original:
Generators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
random_device(C++11)
ディストリビューション
Original:
Distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
一様分布
Original:
Uniform distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
uniform_int_distribution(C++11)
uniform_real_distribution(C++11)
generate_canonical(C++11)
ベルヌーイ分布
Original:
Bernoulli distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bernoulli_distribution(C++11)
binomial_distribution(C++11)
negative_binomial_distribution(C++11)
geometric_distribution(C++11)
ポアソン分布
Original:
Poisson distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
poisson_distribution(C++11)
exponential_distribution(C++11)
gamma_distribution(C++11)
weibull_distribution(C++11)
extreme_value_distribution(C++11)
正規分布
Original:
Normal distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
normal_distribution(C++11)
lognormal_distribution(C++11)
chi_squared_distribution(C++11)
cauchy_distribution(C++11)
fisher_f_distribution(C++11)
student_t_distribution(C++11)
サンプリング分布
Original:
Sampling distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
discrete_distribution(C++11)
piecewise_constant_distribution(C++11)
piecewise_linear_distribution(C++11)
シードシーケンス
Original:
Seed Sequences
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
seed_seq(C++11)
Cライブラリ
Original:
C library
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rand
srand
RAND_MAX
 
std::discrete_distribution
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
discrete_distribution::discrete_distribution
discrete_distribution::reset
世代
Original:
Generation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
discrete_distribution::operator()
特性
Original:
Characteristics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
discrete_distribution::probabilities
discrete_distribution::param
discrete_distribution::min
discrete_distribution::max
非メンバ関数
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator==
operator!=
operator<<
operator>>
 
discrete_distribution();
(1) (C + + 11以来)
template< class InputIt >
discrete_distribution( InputIt first, InputIt last );
(2) (C + + 11以来)
discrete_distribution( std::initializer_list<double> weights );
(3) (C + + 11以来)
template< class UnaryOperation >

discrete_distribution( std::size_t count, double xmin, double xmax,

                       UnaryOperation unary_op );
(4) (C + + 11以来)
explicit discrete_distribution( const param_type& params );
(2) (C + + 11以来)
新しいディストリビューオブジェクトを構築し.
Original:
Constructs a new distribution object.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
デフォルトのコンストラクタです。重み持つ分布を構築します。このディストリビューションは常に0を生成します.
Original:
Default constructor. Constructs the distribution with weights . This distribution will always generate 0.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
レンジ[first, last)で重みを持つ分布を構築します。 first == last場合、効果はデフォルトコンストラクタの場合と同じです.
Original:
Constructs the distribution with weights in the range [first, last). If first == last, the effects are the same as of the default constructor.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
weightsで重みを持つディストリビューションを構築します。効果的にinitializer_list(weigths.begin(), weights.end())呼び出し.
Original:
Constructs the distribution with weights in weights. Effectively calls initializer_list(weigths.begin(), weights.end()).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
4)
関数countを使用して生成されunary_opの重みを持つディストリビューションを構築します。どこw
i
= unary_op(xmin + δ/2 + i · δ)
δ =
(xmax − xmin)
count
重みのそれぞれは、i ∈ {0, ..., count−1}に等しくなります。 xminxmaxようδ > 0でなければなりません。 count == 0効果はデフォルトコンストラクタのと同じである場合.
Original:
Constructs the distribution with count weights that are generated using function unary_op. Each of the weights is equal to w
i
= unary_op(xmin + δ/2 + i · δ)
, where δ =
(xmax − xmin)
count
and i ∈ {0, ..., count−1}. xmin and xmax must be such that δ > 0. If count == 0 the effects are the same as of the default constructor.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
5)
分布パラメータとしてparamsとディストリビューションを構築し.
Original:
Constructs the distribution with params as the distribution parameters.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] パラメータ

first, last -
重みとして使用する番号を定義する要素の範囲。 InputIteratorで参照要素の型がdoubleに変換できる必要があります
Original:
the range of elements defining the numbers to use as weights. The type of the elements referred by InputIterator must be convertible to double
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
weights -
重みを含む初期化子リスト
Original:
initializer list containing the weights
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unary_op - unary operation function object that will be applied.

The signature of the function should be equivalent to the following:

 Ret fun(const Type &a);

The signature does not need to have const &.
The type  Type must be such that an object of type double can be dereferenced and then implicitly converted to  Type. The type  Ret must be such that an object of type double can be dereferenced and assigned a value of type  Ret. ​

params -
分布パラメータセット
Original:
the distribution parameter set
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Type requirements
-
InputIt must meet the requirements of InputIterator.