Standard library header <random> (C++11)
이 헤더는 의사 난수 생성 라이브러리의 일부입니다.
사전 정의된 생성기 |
|
minstd_rand0
(C++11)
|
std::
linear_congruential_engine
<
std::
uint_fast32_t
,
16807
,
0
,
2147483647
>
1969년 Lewis, Goodman 및 Miller에 의해 발견되었으며, 1988년 Park과 Miller에 의해 "최소 표준"으로 채택됨 |
minstd_rand
(C++11)
|
std::
linear_congruential_engine
<
std::
uint_fast32_t
,
|
mt19937
(C++11)
|
std::
mersenne_twister_engine
<
std::
uint_fast32_t
,
|
mt19937_64
(C++11)
|
std::
mersenne_twister_engine
<
std::
uint_fast64_t
,
|
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
>
24비트 RANLUX 생성기 (Martin Lüscher와 Fred James, 1994) |
ranlux48
(C++11)
|
std::
discard_block_engine
<
std::
ranlux48_base
,
389
,
11
>
48비트 RANLUX 생성기 (Martin Lüscher와 Fred James, 1994) |
knuth_b
(C++11)
|
std:: shuffle_order_engine < std:: minstd_rand0 , 256 > |
philox4x32
(C++26)
|
std::
philox_engine
<
std::
uint_fast32_t
,
32
,
4
,
10
,
0xCD9E8D57
,
0x9E3779B9
,
0xD2511F53
,
0xBB67AE85
>
|
philox4x64
(C++26)
|
std::
philox_engine
<
std::
uint_fast64_t
,
64
,
4
,
10
,
0xCA5A826395121157
,
0x9E3779B97F4A7C15
,
0xD2E7470EE14C6C93
,
0xBB67AE8584CAA73B
>
|
default_random_engine
(C++11)
|
구현 정의 RandomNumberEngine 타입 |
비결정적 난수 |
|
|
(C++11)
|
하드웨어 엔트로피 소스를 사용하는 비결정적 난수 생성기
(클래스) |
균일 분포 |
|
|
(C++11)
|
범위 전체에 걸쳐 균일하게 분포된 정수 값을 생성합니다
(클래스 템플릿) |
|
(C++11)
|
범위 내에서 균일하게 분포된 실수 값을 생성합니다
(클래스 템플릿) |
베르누이 분포 |
|
|
(C++11)
|
bool
값을
베르누이 분포
기반으로 생성합니다
(클래스) |
|
(C++11)
|
이항 분포
상의 정수 값을 생성합니다
(클래스 템플릿) |
|
(C++11)
|
음이항 분포
상의 정수 값을 생성합니다
(클래스 템플릿) |
|
(C++11)
|
기하 분포
상의 정수 값을 생성합니다
(클래스 템플릿) |
포아송 분포 |
|
|
(C++11)
|
푸아송 분포
상의 정수 값을 생성합니다
(클래스 템플릿) |
|
(C++11)
|
지수 분포 상의 실수 값을 생성합니다
exponential distribution
(클래스 템플릿) |
|
(C++11)
|
감마 분포
상의 실수 값을 생성합니다
(클래스 템플릿) |
|
(C++11)
|
실수 값을
Weibull 분포
에 따라 생성합니다
(클래스 템플릿) |
|
(C++11)
|
실수 값을
극값 분포
에 따라 생성함
(클래스 템플릿) |
정규 분포 |
|
|
(C++11)
|
실수 값을
표준 정규 (가우시안) 분포
에 따라 생성합니다
(클래스 템플릿) |
|
(C++11)
|
로그 정규 분포
상의 실수 값을 생성합니다
(클래스 템플릿) |
|
(C++11)
|
실제 값을
카이제곱 분포
상에서 생성합니다
(클래스 템플릿) |
|
(C++11)
|
코시 분포
상의 실수 값을 생성합니다
(클래스 템플릿) |
|
(C++11)
|
Fisher의 F-분포
상의 실수 값을 생성합니다
(클래스 템플릿) |
|
(C++11)
|
실수 값을
스튜던트 t-분포
에 따라 생성합니다
(클래스 템플릿) |
표본 분포 |
|
|
(C++11)
|
이산 분포에서 정수 값을 생성함
(클래스 템플릿) |
|
(C++11)
|
상수 부분 구간에 분포된 실수 값을 생성함
(클래스 템플릿) |
|
(C++11)
|
정의된 부분 구간에 분포된 실수 값을 생성합니다
(클래스 템플릿) |
유틸리티 |
|
|
(C++11)
|
범용 편향 제거 스크램블 시드 시퀀스 생성기
(클래스) |
함수 |
|
|
(C++11)
|
주어진 정밀도의 실수 값을
[
0
,
1
)
구간에 걸쳐 균등하게 분포시킴
(함수 템플릿) |
|
(C++26)
|
균일 난수 비트 생성기로부터 난수로 범위를 채움
(알고리즘 함수 객체) |
시놉시스
#include <initializer_list> namespace std { // 균일 난수 비트 생성기 요구사항 template<class G> concept uniform_random_bit_generator = /* 설명 참조 */; // freestanding // 클래스 템플릿 linear_congruential_engine template<class UIntType, UIntType a, UIntType c, UIntType m> class linear_congruential_engine; // 부분적으로 독립형 // 클래스 템플릿 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; // 부분적으로 독립 구현 가능 // 클래스 템플릿 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; // 클래스 템플릿 philox_engine template<class UIntType, size_t w, size_t n, size_t r, UIntType... consts> class philox_engine; // 부분적으로 독립형 // 미리 정의된 매개변수를 가진 엔진 및 엔진 어댑터 using minstd_rand0 = /* 설명 참조 */; // 독립 실행 환경 using minstd_rand = /* 설명 참조 */; // freestanding using mt19937 = /* 설명 참조 */; // freestanding using mt19937_64 = /* 설명 참조 */; // freestanding using ranlux24_base = /* 설명 참조 */; // 독립 실행 환경 using ranlux48_base = /* 설명 참조 */; // 독립 실행 환경 using ranlux24 = /* 설명 참조 */; // 독립 실행 환경 using ranlux48 = /* 설명 참조 */; // 독립 실행 환경 using knuth_b = /* 설명 참조 */; using philox4x32 = /* 설명 참조 */; // 독립 실행 환경 using philox4x64 = /* 설명 참조 */; // 독립 실행 환경 using default_random_engine = /* 설명 참조 */; // class random_device class random_device; // class seed_seq class seed_seq; // 함수 템플릿 generate_canonical template<class RealType, size_t digits, class URBG> RealType generate_canonical(URBG& g); namespace ranges { // generate_random template<class R, class G> requires output_range<R, invoke_result_t<G&>> && uniform_random_bit_generator<remove_cvref_t<G>> constexpr borrowed_iterator_t<R> generate_random(R&& r, G&& g); template<class G, output_iterator<invoke_result_t<G&>> O, sentinel_for<O> S> requires uniform_random_bit_generator<remove_cvref_t<G>> constexpr O generate_random(O first, S last, G&& g); template<class R, class G, class D> requires output_range<R, invoke_result_t<D&, G&>> && invocable<D&, G&> && uniform_random_bit_generator<remove_cvref_t<G>> && is_arithmetic_v<invoke_result_t<D&, G&>> constexpr borrowed_iterator_t<R> generate_random(R&& r, G&& g, D&& d); template<class G, class D, output_iterator<invoke_result_t<D&, G&>> O, sentinel_for<O> S> requires invocable<D&, G&> && uniform_random_bit_generator<remove_cvref_t<G>> && is_arithmetic_v<invoke_result_t<D&, G&>> constexpr O generate_random(O first, S last, G&& g, D&& d); } // 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; // 클래스 템플릿 binomial_distribution template<class IntType = int> class binomial_distribution; // 클래스 템플릿 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; // 클래스 템플릿 exponential_distribution template<class RealType = double> class exponential_distribution; // 클래스 템플릿 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; // 클래스 템플릿 normal_distribution template<class RealType = double> class normal_distribution; // 클래스 템플릿 lognormal_distribution template<class RealType = double> class lognormal_distribution; // 클래스 템플릿 chi_squared_distribution template<class RealType = double> class chi_squared_distribution; // 클래스 템플릿 cauchy_distribution template<class RealType = double> class cauchy_distribution; // 클래스 템플릿 fisher_f_distribution template<class RealType = double> class fisher_f_distribution; // class template student_t_distribution template<class RealType = double> class student_t_distribution; // 클래스 템플릿 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; }
개념
uniform_random_bit_generator
namespace std { template<class G> concept uniform_random_bit_generator = invocable<G&> && unsigned_integral<invoke_result_t<G&>> && requires { { G::min() } -> same_as<invoke_result_t<G&>>; { G::max() } -> same_as<invoke_result_t<G&>>; requires bool_constant<(G::min() < G::max())>::value; }; }
클래스 템플릿 std::linear_congruential_engine
namespace std { template<class UIntType, UIntType a, UIntType c, UIntType m> class linear_congruential_engine { public: // 타입 using result_type = UIntType; // 엔진 특성 static constexpr result_type multiplier = a; static constexpr result_type increment = c; static constexpr result_type modulus = m; static constexpr result_type min() { return c == 0u ? 1u : 0u; } static constexpr result_type max() { return m - 1u; } static constexpr result_type default_seed = 1u; // 생성자 및 시드 설정 함수 linear_congruential_engine() : linear_congruential_engine(default_seed) { } explicit linear_congruential_engine(result_type s); template<class Sseq> explicit linear_congruential_engine(Sseq& q); void seed(result_type s = default_seed); template<class Sseq> void seed(Sseq& q); // 동등 연산자 friend bool operator==(const linear_congruential_engine& x, const linear_congruential_engine& y); // 생성 함수 result_type operator()(); void discard(unsigned long long z); // 출력 및 입력 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, // 호스팅됨 const linear_congruential_engine& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, // 호스팅됨 linear_congruential_engine& x); }; }
클래스 템플릿 std::mersenne_twister_engine
namespace std { 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 { public: // 타입 using result_type = UIntType; // 엔진 특성 static constexpr size_t word_size = w; static constexpr size_t state_size = n; static constexpr size_t shift_size = m; static constexpr size_t mask_bits = r; static constexpr UIntType xor_mask = a; static constexpr size_t tempering_u = u; static constexpr UIntType tempering_d = d; static constexpr size_t tempering_s = s; static constexpr UIntType tempering_b = b; static constexpr size_t tempering_t = t; static constexpr UIntType tempering_c = c; static constexpr size_t tempering_l = l; static constexpr UIntType initialization_multiplier = f; static constexpr result_type min() { return 0; } static constexpr result_type max() { return /*2^w - 1*/; } static constexpr result_type default_seed = 5489u; // 생성자 및 시드 설정 함수 mersenne_twister_engine() : mersenne_twister_engine(default_seed) { } explicit mersenne_twister_engine(result_type value); template<class Sseq> explicit mersenne_twister_engine(Sseq& q); void seed(result_type value = default_seed); template<class Sseq> void seed(Sseq& q); // 동등 연산자 friend bool operator==(const mersenne_twister_engine& x, const mersenne_twister_engine& y); // 생성 함수 result_type operator()(); void discard(unsigned long long z); // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, // 호스팅됨 const mersenne_twister_engine& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, // 호스팅됨 mersenne_twister_engine& x); }; }
클래스 템플릿 std::subtract_with_carry_engine
namespace std { template<class UIntType, size_t w, size_t s, size_t r> class subtract_with_carry_engine { public: // 타입 using result_type = UIntType; // 엔진 특성 static constexpr size_t word_size = w; static constexpr size_t short_lag = s; static constexpr size_t long_lag = r; static constexpr result_type min() { return 0; } static constexpr result_type max() { return /*m - 1*/; } static constexpr uint_least32_t default_seed = 19780503u; // 생성자 및 시드 설정 함수 subtract_with_carry_engine() : subtract_with_carry_engine(0u) { } explicit subtract_with_carry_engine(result_type value); template<class Sseq> explicit subtract_with_carry_engine(Sseq& q); void seed(result_type value = 0u); template<class Sseq> void seed(Sseq& q); // 동등 연산자 friend bool operator==(const subtract_with_carry_engine& x, const subtract_with_carry_engine& y); // 생성 함수 result_type operator()(); void discard(unsigned long long z); // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, // 호스팅됨 const subtract_with_carry_engine& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, // 호스팅됨 subtract_with_carry_engine& x); }; }
클래스 템플릿 std::philox_engine
namespace std { template<class UIntType, size_t w, size_t n, size_t r, UIntType... consts> class philox_engine { static constexpr size_t /*array-size*/ = n / 2; // 설명 전용 public: // 타입 using result_type = UIntType; // 엔진 특성 static constexpr size_t word_size = w; static constexpr size_t word_count = n; static constexpr size_t round_count = r; static constexpr array<result_type, /*array-size*/> multipliers; static constexpr array < result_type, @설명 전용id { array - size > } @round_consts; static constexpr result_type min() { return 0; } static constexpr result_type max() { return m - 1; } static constexpr result_type default_seed = 20111115u; // 생성자 및 시드 설정 함수 philox_engine() : philox_engine(default_seed) { } explicit philox_engine(result_type value); template<class Sseq> explicit philox_engine(Sseq& q); void seed(result_type value = default_seed); template<class Sseq> void seed(Sseq& q); void set_counter(const array<result_type, n>& counter); // 동등 연산자 friend bool operator==(const philox_engine& x, const philox_engine& y); // 생성 함수 result_type operator()(); void discard(unsigned long long z); // 출력 및 입력 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, // 호스팅됨 const philox_engine& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, // 호스팅됨 philox_engine& x); }; }
클래스 템플릿 std::discard_block_engine
namespace std { template<class Engine, size_t p, size_t r> class discard_block_engine { public: // 타입 using result_type = typename Engine::result_type; // 엔진 특성 static constexpr size_t block_size = p; static constexpr size_t used_block = r; static constexpr result_type min() { return Engine::min(); } static constexpr result_type max() { return Engine::max(); } // 생성자 및 시드 설정 함수 discard_block_engine(); explicit discard_block_engine(const Engine& e); explicit discard_block_engine(Engine&& e); explicit discard_block_engine(result_type s); template<class Sseq> explicit discard_block_engine(Sseq& q); void seed(); void seed(result_type s); template<class Sseq> void seed(Sseq& q); // 동등 연산자 friend bool operator==(const discard_block_engine& x, const discard_block_engine& y); // 생성 함수 result_type operator()(); void discard(unsigned long long z); // 속성 함수 const Engine& base() const noexcept { return e; } // 입출력 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, // 호스팅됨 const discard_block_engine& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, // 호스팅됨 discard_block_engine& x); private: Engine e; // 설명 전용 size_t n; // 설명 전용 }; }
클래스 템플릿 std::independent_bits_engine
namespace std { template<class Engine, size_t w, class UIntType> class independent_bits_engine { public: // 타입 using result_type = UIntType; // 엔진 특성 static constexpr result_type min() { return 0; } static constexpr result_type max() { return /*2^w - 1*/; } // 생성자 및 시드 설정 함수 independent_bits_engine(); explicit independent_bits_engine(const Engine& e); explicit independent_bits_engine(Engine&& e); explicit independent_bits_engine(result_type s); template<class Sseq> explicit independent_bits_engine(Sseq& q); void seed(); void seed(result_type s); template<class Sseq> void seed(Sseq& q); // 동등 연산자 friend bool operator==(const independent_bits_engine& x, const independent_bits_engine& y); // 생성 함수 result_type operator()(); void discard(unsigned long long z); // 속성 함수 const Engine& base() const noexcept { return e; } // 출력 및 입력 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, // 호스팅됨 const independent_bits_engine& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, // 호스팅됨 independent_bits_engine& x); private: Engine e; // 설명 전용 }; }
클래스 템플릿 std::shuffle_order_engine
namespace std { template<class Engine, size_t k> class shuffle_order_engine { public: // 타입 using result_type = typename Engine::result_type; // 엔진 특성 static constexpr size_t table_size = k; static constexpr result_type min() { return Engine::min(); } static constexpr result_type max() { return Engine::max(); } // 생성자 및 시드 설정 함수 shuffle_order_engine(); explicit shuffle_order_engine(const Engine& e); explicit shuffle_order_engine(Engine&& e); explicit shuffle_order_engine(result_type s); template<class Sseq> explicit shuffle_order_engine(Sseq& q); void seed(); void seed(result_type s); template<class Sseq> void seed(Sseq& q); // 동등 연산자 friend bool operator==(const shuffle_order_engine& x, const shuffle_order_engine& y); // 생성 함수 result_type operator()(); void discard(unsigned long long z); // 속성 함수 const Engine& base() const noexcept { return e; } // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const shuffle_order_engine& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, shuffle_order_engine& x); private: Engine e; // 설명 전용 result_type V[k]; // 설명 전용 result_type Y; // 설명 전용 }; }
미리 정의된 매개변수를 가진 엔진 및 엔진 어댑터
namespace std { using minstd_rand0 = linear_congruential_engine<uint_fast32_t, 16'807, 0, 2'147'483'647>; using minstd_rand = linear_congruential_engine<uint_fast32_t, 48'271, 0, 2'147'483'647>; using mt19937 = mersenne_twister_engine<uint_fast32_t, 32, 624, 397, 31, 0x9908'b0df, 11, 0xffff'ffff, 7, 0x9d2c'5680, 15, 0xefc6'0000, 18, 1'812'433'253>; //' using mt19937_64 = mersenne_twister_engine<uint_fast64_t, 64, 312, 156, 31, 0xb502'6f5a'a966'19e9, 29, 0x5555'5555'5555'5555, 17, 0x71d6'7fff'eda6'0000, 37, 0xfff7'eee0'0000'0000, 43, 6'364'136'223'846'793'005>; using ranlux24_base = subtract_with_carry_engine<uint_fast32_t, 24, 10, 24>; using ranlux48_base = subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>; using ranlux24 = discard_block_engine<ranlux24_base, 223, 23>; using ranlux48 = discard_block_engine<ranlux48_base, 389, 11>; using knuth_b = shuffle_order_engine<minstd_rand0, 256>; using default_random_engine = /* 구현 정의 */; using philox4x32 = philox_engine<uint_fast32_t, 32, 4, 10, 0xD2511F53, 0x9E3779B9, 0xCD9E8D57, 0xBB67AE85>; using philox4x64 = philox_engine<uint_fast64_t, 64, 4, 10, 0xD2E7470EE14C6C93, 0x9E3779B97F4A7C15, 0xCA5A826395121157, 0xBB67AE8584CAA73B>; }
클래스 std::random_device
namespace std { class random_device { public: // 타입 using result_type = unsigned int; // 생성자 특성 static constexpr result_type min() { return numeric_limits<result_type>::min(); } static constexpr result_type max() { return numeric_limits<result_type>::max(); } // 생성자 random_device() : random_device(/* 구현 정의 */) { } explicit random_device(const string& token); // 생성 함수 result_type operator()(); // 속성 함수 double entropy() const noexcept; // 복사 함수 없음 random_device(const random_device&) = delete; void operator=(const random_device&) = delete; }; }
클래스 std::seed_seq
namespace std { class seed_seq { public: // 타입 using result_type = uint_least32_t; // 생성자 seed_seq() noexcept; template<class T> seed_seq(initializer_list<T> il); template<class InputIter> seed_seq(InputIter begin, InputIter end); // 생성 함수 template<class RandomAccessIter> void generate(RandomAccessIter begin, RandomAccessIter end); // 속성 함수 size_t size() const noexcept; template<class OutputIter> void param(OutputIter dest) const; // 복사 함수 없음 seed_seq(const seed_seq&) = delete; void operator=(const seed_seq&) = delete; private: vector<result_type> v; // 설명 전용 }; }
클래스 템플릿 std::uniform_int_distribution
namespace std { template<class IntType = int> class uniform_int_distribution { public: // 타입 using result_type = IntType; using param_type = /* 지정되지 않음 */; // 생성자 및 재설정 함수 uniform_int_distribution() : uniform_int_distribution(0) { } explicit uniform_int_distribution(IntType a, IntType b = numeric_limits<IntType>::max()); explicit uniform_int_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const uniform_int_distribution& x, const uniform_int_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 result_type a() const; result_type b() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, // 호스팅됨 const uniform_int_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, // 호스팅됨 uniform_int_distribution& x); }; }
클래스 템플릿 std::uniform_real_distribution
namespace std { template<class RealType = double> class uniform_real_distribution { public: // 타입 using result_type = RealType; using param_type = /* 지정되지 않음 */; // 생성자 및 리셋 함수 uniform_real_distribution() : uniform_real_distribution(0.0) { } explicit uniform_real_distribution(RealType a, RealType b = 1.0); explicit uniform_real_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const uniform_real_distribution& x, const uniform_real_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 result_type a() const; result_type b() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 입출력 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const uniform_real_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, uniform_real_distribution& x); }; }
클래스 std::bernoulli_distribution
namespace std { class bernoulli_distribution { public: // 타입 using result_type = bool; using param_type = /* 지정되지 않음 */; // 생성자 및 리셋 함수 bernoulli_distribution() : bernoulli_distribution(0.5) { } explicit bernoulli_distribution(double p); explicit bernoulli_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const bernoulli_distribution& x, const bernoulli_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 double p() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 입출력 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const bernoulli_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, bernoulli_distribution& x); }; }
클래스 템플릿 std::binomial_distribution
namespace std { template<class IntType = int> class binomial_distribution { public: // 타입 using result_type = IntType; using param_type = /* 지정되지 않음 */; // 생성자 및 리셋 함수 binomial_distribution() : binomial_distribution(1) { } explicit binomial_distribution(IntType t, double p = 0.5); explicit binomial_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const binomial_distribution& x, const binomial_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 IntType t() const; double p() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const binomial_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, binomial_distribution& x); }; }
클래스 템플릿 std::geometric_distribution
namespace std { template<class IntType = int> class geometric_distribution { public: // 타입 using result_type = IntType; using param_type = /* 지정되지 않음 */; // 생성자 및 재설정 함수 geometric_distribution() : geometric_distribution(0.5) { } explicit geometric_distribution(double p); explicit geometric_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const geometric_distribution& x, const geometric_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 double p() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const geometric_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, geometric_distribution& x); }; }
클래스 템플릿 std::negative_binomial_distribution
namespace std { template<class IntType = int> class negative_binomial_distribution { public: // 타입 using result_type = IntType; using param_type = /* 지정되지 않음 */; // 생성자 및 재설정 함수 negative_binomial_distribution() : negative_binomial_distribution(1) { } explicit negative_binomial_distribution(IntType k, double p = 0.5); explicit negative_binomial_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const negative_binomial_distribution& x, const negative_binomial_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 IntType k() const; double p() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 입출력 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<( basic_ostream<CharT, Traits>& os, const negative_binomial_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, negative_binomial_distribution& x); }; }
클래스 템플릿 std::poisson_distribution
namespace std { template<class IntType = int> class poisson_distribution { public: // 타입 using result_type = IntType; using param_type = /* 지정되지 않음 */; // 생성자 및 재설정 함수 poisson_distribution() : poisson_distribution(1.0) { } explicit poisson_distribution(double mean); explicit poisson_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const poisson_distribution& x, const poisson_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 double mean() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const poisson_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, poisson_distribution& x); }; }
클래스 템플릿 std::exponential_distribution
namespace std { template<class RealType = double> class exponential_distribution { public: // 타입 using result_type = RealType; using param_type = /* 지정되지 않음 */; // 생성자 및 리셋 함수 exponential_distribution() : exponential_distribution(1.0) { } explicit exponential_distribution(RealType lambda); explicit exponential_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const exponential_distribution& x, const exponential_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 RealType lambda() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 입출력 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const exponential_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, exponential_distribution& x); }; }
클래스 템플릿 std::gamma_distribution
namespace std { template<class RealType = double> class gamma_distribution { public: // 타입 using result_type = RealType; using param_type = /* 지정되지 않음 */; // 생성자 및 리셋 함수 gamma_distribution() : gamma_distribution(1.0) { } explicit gamma_distribution(RealType alpha, RealType beta = 1.0); explicit gamma_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const gamma_distribution& x, const gamma_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 RealType alpha() const; RealType beta() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const gamma_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, gamma_distribution& x); }; }
클래스 템플릿 std::weibull_distribution
namespace std { template<class RealType = double> class weibull_distribution { public: // 타입 using result_type = RealType; using param_type = /* 지정되지 않음 */; // 생성자 및 재설정 함수 weibull_distribution() : weibull_distribution(1.0) { } explicit weibull_distribution(RealType a, RealType b = 1.0); explicit weibull_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const weibull_distribution& x, const weibull_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 RealType a() const; RealType b() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const weibull_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, weibull_distribution& x); }; }
클래스 템플릿 std::extreme_value_distribution
namespace std { template<class RealType = double> class extreme_value_distribution { public: // 타입 using result_type = RealType; using param_type = /* 지정되지 않음 */; // 생성자 및 리셋 함수 extreme_value_distribution() : extreme_value_distribution(0.0) { } explicit extreme_value_distribution(RealType a, RealType b = 1.0); explicit extreme_value_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const extreme_value_distribution& x, const extreme_value_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 RealType a() const; RealType b() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const extreme_value_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, extreme_value_distribution& x); }; }
클래스 템플릿 std::normal_distribution
namespace std { template<class RealType = double> class normal_distribution { public: // 타입 using result_type = RealType; using param_type = /* 지정되지 않음 */; // 생성자 및 리셋 함수 normal_distribution() : normal_distribution(0.0) { } explicit normal_distribution(RealType mean, RealType stddev = 1.0); explicit normal_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const normal_distribution& x, const normal_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 RealType mean() const; RealType stddev() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 삽입자 및 추출자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const normal_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, normal_distribution& x); }; }
클래스 템플릿 std::lognormal_distribution
namespace std { template<class RealType = double> class lognormal_distribution { public: // 타입 using result_type = RealType; using param_type = /* 지정되지 않음 */; // 생성자 및 재설정 함수 lognormal_distribution() : lognormal_distribution(0.0) { } explicit lognormal_distribution(RealType m, RealType s = 1.0); explicit lognormal_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const lognormal_distribution& x, const lognormal_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 RealType m() const; RealType s() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const lognormal_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, lognormal_distribution& x); }; }
클래스 템플릿 std::chi_squared_distribution
namespace std { template<class RealType = double> class chi_squared_distribution { public: // 타입 using result_type = RealType; using param_type = /* 지정되지 않음 */; // 생성자 및 재설정 함수 chi_squared_distribution() : chi_squared_distribution(1.0) { } explicit chi_squared_distribution(RealType n); explicit chi_squared_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const chi_squared_distribution& x, const chi_squared_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 RealType n() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const chi_squared_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, chi_squared_distribution& x); }; }
클래스 템플릿 std::cauchy_distribution
namespace std { template<class RealType = double> class cauchy_distribution { public: // 타입 using result_type = RealType; using param_type = /* 지정되지 않음 */; // 생성자 및 리셋 함수 cauchy_distribution() : cauchy_distribution(0.0) { } explicit cauchy_distribution(RealType a, RealType b = 1.0); explicit cauchy_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const cauchy_distribution& x, const cauchy_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 RealType a() const; RealType b() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const cauchy_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, cauchy_distribution& x); }; }
클래스 템플릿 std::fisher_f_distribution
namespace std { template<class RealType = double> class fisher_f_distribution { public: // 타입 using result_type = RealType; using param_type = /* 지정되지 않음 */; // 생성자 및 재설정 함수 fisher_f_distribution() : fisher_f_distribution(1.0) { } explicit fisher_f_distribution(RealType m, RealType n = 1.0); explicit fisher_f_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const fisher_f_distribution& x, const fisher_f_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 RealType m() const; RealType n() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const fisher_f_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, fisher_f_distribution& x); }; }
클래스 템플릿 std::student_t_distribution
namespace std { template<class RealType = double> class student_t_distribution { public: // 타입 using result_type = RealType; using param_type = /* 지정되지 않음 */; // 생성자 및 재설정 함수 student_t_distribution() : student_t_distribution(1.0) { } explicit student_t_distribution(RealType n); explicit student_t_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const student_t_distribution& x, const student_t_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 RealType n() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 입출력 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const student_t_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, student_t_distribution& x); }; }
클래스 템플릿 std::discrete_distribution
namespace std { template<class IntType = int> class discrete_distribution { public: // 타입 using result_type = IntType; using param_type = /* 지정되지 않음 */; // 생성자 및 재설정 함수 discrete_distribution(); template<class InputIter> discrete_distribution(InputIter firstW, InputIter lastW); discrete_distribution(initializer_list<double> wl); template<class UnaryOperation> discrete_distribution(size_t nw, double xmin, double xmax, UnaryOperation fw); explicit discrete_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const discrete_distribution& x, const discrete_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 vector<double> probabilities() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& os, const discrete_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, discrete_distribution& x); }; }
클래스 템플릿 std::piecewise_constant_distribution
namespace std { template<class RealType = double> class piecewise_constant_distribution { public: // 타입 using result_type = RealType; using param_type = /* 지정되지 않음 */; // 생성자 및 리셋 함수 piecewise_constant_distribution(); template<class InputIterB, class InputIterW> piecewise_constant_distribution(InputIterB firstB, InputIterB lastB, InputIterW firstW); template<class UnaryOperation> piecewise_constant_distribution(initializer_list<RealType> bl, UnaryOperation fw); template<class UnaryOperation> piecewise_constant_distribution(size_t nw, RealType xmin, RealType xmax, UnaryOperation fw); explicit piecewise_constant_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const piecewise_constant_distribution& x, const piecewise_constant_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 vector<result_type> intervals() const; vector<result_type> densities() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<( basic_ostream<CharT, Traits>& os, const piecewise_constant_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, piecewise_constant_distribution& x); }; }
클래스 템플릿 std::piecewise_linear_distribution
namespace std { template<class RealType = double> class piecewise_linear_distribution { public: // 타입 using result_type = RealType; using param_type = /* 지정되지 않음 */; // 생성자 및 재설정 함수 piecewise_linear_distribution(); template<class InputIterB, class InputIterW> piecewise_linear_distribution(InputIterB firstB, InputIterB lastB, InputIterW firstW); template<class UnaryOperation> piecewise_linear_distribution(initializer_list<RealType> bl, UnaryOperation fw); template<class UnaryOperation> piecewise_linear_distribution(size_t nw, RealType xmin, RealType xmax, UnaryOperation fw); explicit piecewise_linear_distribution(const param_type& parm); void reset(); // 동등 연산자 friend bool operator==(const piecewise_linear_distribution& x, const piecewise_linear_distribution& y); // 생성 함수 template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); // 속성 함수 vector<result_type> intervals() const; vector<result_type> densities() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; // 삽입 및 추출 연산자 template<class CharT, class Traits> friend basic_ostream<CharT, Traits>& operator<<( basic_ostream<CharT, Traits>& os, const piecewise_linear_distribution& x); template<class CharT, class Traits> friend basic_istream<CharT, Traits>& operator>>(basic_istream<CharT, Traits>& is, piecewise_linear_distribution& x); }; }