標準ライブラリヘッダ <random>
このヘッダは擬似乱数生成ライブラリの一部です。
一様ランダムビットジェネレータの要件 | ||
| (C++20) |
型が一様ランダムビットジェネレータとして適格であることを指定します (コンセプト) | |
乱数エンジン | ||
| (C++11) |
線形合同法のアルゴリズムを実装します (クラステンプレート) | |
| (C++11) |
メルセンヌ・ツイスタのアルゴリズムを実装します (クラステンプレート) | |
| (C++11) |
キャリー付き減算 (ラグ付きフィボナッチ法) のアルゴリズムを実装します (クラステンプレート) | |
乱数生成エンジンアダプタ | ||
| (C++11) |
乱数エンジンの出力をいくらか破棄します (クラステンプレート) | |
| (C++11) |
指定されたビット数のブロックに乱数の出力をパックします (クラステンプレート) | |
| (C++11) |
乱数エンジンの出力を異なる順序に並び替えます (クラステンプレート) | |
定義済みの乱数生成エンジン | ||
minstd_rand0(C++11)
|
std::linear_congruential_engine<std::uint_fast32_t, 16807, 0, 2147483647> Lewis、 Goodman および Miller によって1969年に発見され、 Park と Miller によって1988年に「最低基準」として選定されたもの | |
minstd_rand(C++11)
|
std::linear_congruential_engine<std::uint_fast32_t, 48271, 0, 2147483647> Park、 Miller および Stockmeyer によって1993年に推奨された新たな「最低基準」 | |
mt19937(C++11)
|
std::mersenne_twister_engine<std::uint_fast32_t, 32, 624, 397, 31, | |
mt19937_64(C++11)
|
std::mersenne_twister_engine<std::uint_fast64_t, 64, 312, 156, 31, | |
ranlux24_base(C++11)
|
std::subtract_with_carry_engine<std::uint_fast32_t, 24, 10, 24> | |
ranlux48_base(C++11)
|
std::subtract_with_carry_engine<std::uint_fast64_t, 48, 5, 12> | |
ranlux24(C++11)
|
std::discard_block_engine<std::ranlux24_base, 223, 23> Martin Lüscher と Fred James による24ビットの RANLUX ジェネレータ (1994年) | |
ranlux48(C++11)
|
std::discard_block_engine<std::ranlux48_base, 389, 11> Martin Lüscher と Fred James による48ビットの RANLUX ジェネレータ (1994年) | |
knuth_b(C++11)
|
std::shuffle_order_engine<std::minstd_rand0, 256> | |
default_random_engine
|
処理系定義 | |
非決定的な乱数 | ||
| (C++11) |
ハードウェアエントロピーソースを使用する非決定的な乱数生成器 (クラス) | |
一様分布 | ||
| (C++11) |
範囲内に一様に分布した整数値を生成します (クラステンプレート) | |
| (C++11) |
範囲内に一様に分布した実数値を生成します (クラステンプレート) | |
ベルヌーイ分布 | ||
| (C++11) |
ベルヌーイ分布に従った bool 値を生成します。 (クラス) | |
| (C++11) |
二項分布に従った整数値を生成します。 (クラステンプレート) | |
| 負の二項分布に従った整数値を生成します。 (クラステンプレート) | ||
| (C++11) |
幾何分布に従った整数値を生成します。 (クラステンプレート) | |
ポアソン分布 | ||
| (C++11) |
ポアソン分布に従った整数値を生成します。 (クラステンプレート) | |
| (C++11) |
指数分布に従った実数値を生成します。 (クラステンプレート) | |
| (C++11) |
ガンマ分布に従った実数値を生成します。 (クラステンプレート) | |
| (C++11) |
ワイブル分布に従った実数値を生成します。 (クラステンプレート) | |
| (C++11) |
極値分布に従った実数値を生成します。 (クラステンプレート) | |
正規分布 | ||
| (C++11) |
標準正規 (ガウス) 分布に従った実数値を生成します。 (クラステンプレート) | |
| (C++11) |
対数正規分布に従った実数値を生成します。 (クラステンプレート) | |
| (C++11) |
カイ二乗分布に従った実数値を生成します。 (クラステンプレート) | |
| (C++11) |
コーシー分布に従った実数値を生成します。 (クラステンプレート) | |
| (C++11) |
フィッシャーのF分布に従った実数値を生成します。 (クラステンプレート) | |
| (C++11) |
スチューデントのt分布に従った実数値を生成します。 (クラステンプレート) | |
標本分布 | ||
| (C++11) |
指定された離散分布に従ったランダムな整数を生成します。 (クラステンプレート) | |
| 指定された区間に一定に分布する実数値を生成します。 (クラステンプレート) | ||
| 指定された区間に線形に分布する実数値を生成します。 (クラステンプレート) | ||
ユーティリティ | ||
| (C++11) |
[0, 1) 内に一様に分布した、与えられた精度における実数値 (関数テンプレート) | |
| (C++11) |
汎用のバイアス除去付きのスクランブルされたシードシーケンス生成器 (クラス) | |
[編集] 概要
#include <initializer_list> namespace std { // uniform random bit generator requirements template<class G> concept uniform_random_bit_generator = /*see below*/; // class template linear_congruential_engine template<class UIntType, UIntType a, UIntType c, UIntType m> class linear_congruential_engine; // class template mersenne_twister_engine template<class UIntType, size_t w, size_t n, size_t m, size_t r, UIntType a, size_t u, UIntType d, size_t s, UIntType b, size_t t, UIntType c, size_t l, UIntType f> class mersenne_twister_engine; // class template subtract_with_carry_engine template<class UIntType, size_t w, size_t s, size_t r> class subtract_with_carry_engine; // class template discard_block_engine template<class Engine, size_t p, size_t r> class discard_block_engine; // class template independent_bits_engine template<class Engine, size_t w, class UIntType> class independent_bits_engine; // class template shuffle_order_engine template<class Engine, size_t k> class shuffle_order_engine; // engines and engine adaptors with predefined parameters using minstd_rand0 = /*see description*/ ; using minstd_rand = /*see description*/ ; using mt19937 = /*see description*/ ; using mt19937_64 = /*see description*/ ; using ranlux24_base = /*see description*/ ; using ranlux48_base = /*see description*/ ; using ranlux24 = /*see description*/ ; using ranlux48 = /*see description*/ ; using knuth_b = /*see description*/ ; using default_random_engine = /*see description*/ ; // class random_device class random_device; // class seed_seq class seed_seq; // function template generate_canonical template<class RealType, size_t bits, class URBG> RealType generate_canonical(URBG& g); // class template uniform_int_distribution template<class IntType = int> class uniform_int_distribution; // class template uniform_real_distribution template<class RealType = double> class uniform_real_distribution; // class bernoulli_distribution class bernoulli_distribution; // class template binomial_distribution template<class IntType = int> class binomial_distribution; // class template geometric_distribution template<class IntType = int> class geometric_distribution; // class template negative_binomial_distribution template<class IntType = int> class negative_binomial_distribution; // class template poisson_distribution template<class IntType = int> class poisson_distribution; // class template exponential_distribution template<class RealType = double> class exponential_distribution; // class template gamma_distribution template<class RealType = double> class gamma_distribution; // class template weibull_distribution template<class RealType = double> class weibull_distribution; // class template extreme_value_distribution template<class RealType = double> class extreme_value_distribution; // class template normal_distribution template<class RealType = double> class normal_distribution; // class template lognormal_distribution template<class RealType = double> class lognormal_distribution; // class template chi_squared_distribution template<class RealType = double> class chi_squared_distribution; // class template cauchy_distribution template<class RealType = double> class cauchy_distribution; // class template fisher_f_distribution template<class RealType = double> class fisher_f_distribution; // class template student_t_distribution template<class RealType = double> class student_t_distribution; // class template discrete_distribution template<class IntType = int> class discrete_distribution; // class template piecewise_constant_distribution template<class RealType = double> class piecewise_constant_distribution; // class template piecewise_linear_distribution template<class RealType = double> class piecewise_linear_distribution; }

