Files
cppdraft_translate/cppdraft/rand/synopsis.md
2025-10-25 03:02:53 +03:00

9.7 KiB

[rand.synopsis]

29 Numerics library [numerics]

29.5 Random number generation [rand]

29.5.2 Header synopsis [rand.synopsis]

#include <initializer_list> // see [initializer.list.syn]namespace std {// [rand.req.urng], uniform random bit generator requirementstemplateconcept uniform_random_bit_generator = see below; // freestanding// [rand.eng.lcong], class template linear_congruential_enginetemplate<class UIntType, UIntType a, UIntType c, UIntType m>class linear_congruential_engine; // partially freestanding// [rand.eng.mers], class template mersenne_twister_enginetemplate<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; // [rand.eng.sub], class template subtract_with_carry_enginetemplate<class UIntType, size_t w, size_t s, size_t r>class subtract_with_carry_engine; // partially freestanding// [rand.adapt.disc], class template discard_block_enginetemplate<class Engine, size_t p, size_t r>class discard_block_engine; // partially freestanding// [rand.adapt.ibits], class template independent_bits_enginetemplate<class Engine, size_t w, class UIntType>class independent_bits_engine; // partially freestanding// [rand.adapt.shuf], class template shuffle_order_enginetemplate<class Engine, size_t k>class shuffle_order_engine; // [rand.eng.philox], class template philox_enginetemplate<class UIntType, size_t w, size_t n, size_t r, UIntType... consts>class philox_engine; // partially freestanding// [rand.predef], engines and engine adaptors with predefined parametersusing minstd_rand0 = see below; // freestandingusing minstd_rand = see below; // freestandingusing mt19937 = see below; // freestandingusing mt19937_64 = see below; // freestandingusing ranlux24_base = see below; // freestandingusing ranlux48_base = see below; // freestandingusing ranlux24 = see below; // freestandingusing ranlux48 = see below; // freestandingusing knuth_b = see below; using philox4x32 = see below; // freestandingusing philox4x64 = see below; // freestandingusing default_random_engine = see below; // [rand.device], class random_deviceclass random_device; // [rand.util.seedseq], class seed_seqclass seed_seq; // [rand.util.canonical], function template generate_canonicaltemplate<class RealType, size_t digits, class URBG> RealType generate_canonical(URBG& g); namespace ranges {// [alg.rand.generate], generate_randomtemplate<class R, class G>requires output_range<R, invoke_result_t<G&>> &&uniform_random_bit_generator<remove_cvref_t>constexpr borrowed_iterator_t generate_random(R&& r, G&& g); template<class G, output_iterator<invoke_result_t<G&>> O, sentinel_for S>requires uniform_random_bit_generator<remove_cvref_t>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> && is_arithmetic_v<invoke_result_t<D&, G&>>constexpr borrowed_iterator_t generate_random(R&& r, G&& g, D&& d); template<class G, class D, output_iterator<invoke_result_t<D&, G&>> O, sentinel_for S>requires invocable<D&, G&> && uniform_random_bit_generator<remove_cvref_t> && is_arithmetic_v<invoke_result_t<D&, G&>>constexpr O generate_random(O first, S last, G&& g, D&& d); }// [rand.dist.uni.int], class template uniform_int_distributiontemplateclass uniform_int_distribution; // partially freestanding// [rand.dist.uni.real], class template uniform_real_distributiontemplateclass uniform_real_distribution; // [rand.dist.bern.bernoulli], class bernoulli_distributionclass bernoulli_distribution; // [rand.dist.bern.bin], class template binomial_distributiontemplateclass binomial_distribution; // [rand.dist.bern.geo], class template geometric_distributiontemplateclass geometric_distribution; // [rand.dist.bern.negbin], class template negative_binomial_distributiontemplateclass negative_binomial_distribution; // [rand.dist.pois.poisson], class template poisson_distributiontemplateclass poisson_distribution; // [rand.dist.pois.exp], class template exponential_distributiontemplateclass exponential_distribution; // [rand.dist.pois.gamma], class template gamma_distributiontemplateclass gamma_distribution; // [rand.dist.pois.weibull], class template weibull_distributiontemplateclass weibull_distribution; // [rand.dist.pois.extreme], class template extreme_value_distributiontemplateclass extreme_value_distribution; // [rand.dist.norm.normal], class template normal_distributiontemplateclass normal_distribution; // [rand.dist.norm.lognormal], class template lognormal_distributiontemplateclass lognormal_distribution; // [rand.dist.norm.chisq], class template chi_squared_distributiontemplateclass chi_squared_distribution; // [rand.dist.norm.cauchy], class template cauchy_distributiontemplateclass cauchy_distribution; // [rand.dist.norm.f], class template fisher_f_distributiontemplateclass fisher_f_distribution; // [rand.dist.norm.t], class template student_t_distributiontemplateclass student_t_distribution; // [rand.dist.samp.discrete], class template discrete_distributiontemplateclass discrete_distribution; // [rand.dist.samp.pconst], class template piecewise_constant_distributiontemplateclass piecewise_constant_distribution; // [rand.dist.samp.plinear], class template piecewise_linear_distributiontemplateclass piecewise_linear_distribution;}