1[library Boost.Random
2  [quickbook 1.5]
3  [authors [Maurer, Jens]]
4  [copyright 2000-2005 Jens Maurer, 2009-2010 Steven Watanabe]
5  [license
6      Distributed under the Boost Software License, Version 1.0.
7      (See accompanying file LICENSE_1_0.txt or copy at
8      [@http://www.boost.org/LICENSE_1_0.txt])
9  ]
10  [purpose A complete system for random number generation]
11]
12
13[template sup[text]'''<superscript>'''[text]'''</superscript>''']
14
15[template prng[text] [link boost_random.reference.concepts.pseudo_random_number_generator [text]]]
16[template qrng[text] [link boost_random.reference.concepts.quasi_random_number_generator [text]]]
17[template concepts[text] [link boost_random.reference.concepts [text]]]
18[template generators[text] [link boost_random.reference.generators [text]]]
19[template distributions[text] [link boost_random.reference.distributions [text]]]
20
21[def __NumberGenerator [link boost_random.reference.concepts.number_generator NumberGenerator]]
22[def __UniformRandomNumberGenerator [link boost_random.reference.concepts.uniform_random_number_generator UniformRandomNumberGenerator]]
23[def __PseudoRandomNumberGenerator [link boost_random.reference.concepts.pseudo_random_number_generator PseudoRandomNumberGenerator]]
24[def __QuasiRandomNumberGenerator [link boost_random.reference.concepts.quasi_random_number_generator QuasiRandomNumberGenerator]]
25[def __SeedSeq [link boost_random.reference.concepts.seed_sequence SeedSeq]]
26
27[def __CopyConstructible [@boost:/doc/html/CopyConstructible.html CopyConstructible]]
28[def __Assignable [@boost:/doc/html/Assignable.html Assignable]]
29[def __LessThanComparable [@boost:/doc/html/LessThanComparable.html LessThanComparable]]
30[def __EqualityComparable [@boost:/doc/html/EqualityComparable.html EqualityComparable]]
31[def __Streamable Streamable]
32
33[def __random_device [classref boost::random::random_device random_device]]
34[def __random_number_generator [classref boost::random::random_number_generator random_number_generator]]
35[def __variate_generator [classref boost::random::variate_generator variate_generator]]
36[def __seed_seq [classref boost::random::seed_seq seed_seq]]
37[def __generate_canonical [funcref boost::random::generate_canonical generate_canonical]]
38
39[def __minstd_rand0 [classref boost::random::minstd_rand0 minstd_rand0]]
40[def __minstd_rand [classref boost::random::minstd_rand minstd_rand]]
41[def __rand48 [classref boost::random::rand48 rand48]]
42[def __ecuyer1988 [classref boost::random::ecuyer1988 ecuyer1988]]
43[def __kreutzer1986 [classref boost::random::kreutzer1986 kreutzer1986]]
44[def __knuth_b [classref boost::random::knuth_b knuth_b]]
45[def __taus88 [classref boost::random::taus88 taus88]]
46[def __hellekalek1995 [classref boost::random::hellekalek1995 hellekalek1995]]
47[def __mt11213b [classref boost::random::mt11213b mt11213b]]
48[def __mt19937 [classref boost::random::mt19937 mt19937]]
49[def __mt19937_64 [classref boost::random::mt19937_64 mt19937_64]]
50[def __lagged_fibonacci607 [classref boost::random::lagged_fibonacci607 lagged_fibonacci607]]
51[def __lagged_fibonacci1279 [classref boost::random::lagged_fibonacci1279 lagged_fibonacci1279]]
52[def __lagged_fibonacci2281 [classref boost::random::lagged_fibonacci2281 lagged_fibonacci2281]]
53[def __lagged_fibonacci3217 [classref boost::random::lagged_fibonacci3217 lagged_fibonacci3217]]
54[def __lagged_fibonacci4423 [classref boost::random::lagged_fibonacci4423 lagged_fibonacci4423]]
55[def __lagged_fibonacci9689 [classref boost::random::lagged_fibonacci9689 lagged_fibonacci9689]]
56[def __lagged_fibonacci19937 [classref boost::random::lagged_fibonacci19937 lagged_fibonacci19937]]
57[def __lagged_fibonacci23209 [classref boost::random::lagged_fibonacci23209 lagged_fibonacci23209]]
58[def __lagged_fibonacci44497 [classref boost::random::lagged_fibonacci44497 lagged_fibonacci44497]]
59[def __ranlux3 [classref boost::random::ranlux3 ranlux3]]
60[def __ranlux4 [classref boost::random::ranlux4 ranlux4]]
61[def __ranlux64_3 [classref boost::random::ranlux64_3 ranlux64_3]]
62[def __ranlux64_4 [classref boost::random::ranlux64_4 ranlux64_4]]
63[def __ranlux3_01 [classref boost::random::ranlux3_01 ranlux3_01]]
64[def __ranlux4_01 [classref boost::random::ranlux4_01 ranlux4_01]]
65[def __ranlux64_3_01 [classref boost::random::ranlux64_3_01 ranlux64_3_01]]
66[def __ranlux64_4_01 [classref boost::random::ranlux64_4_01 ranlux64_4_01]]
67[def __ranlux24 [classref boost::random::ranlux24 ranlux24]]
68[def __ranlux48 [classref boost::random::ranlux48 ranlux48]]
69[def __niederreiter_base2 [classref boost::random::niederreiter_base2 niederreiter_base2]]
70[def __sobol [classref boost::random::sobol sobol]]
71[def __faure [classref boost::random::faure faure]]
72
73[def __uniform_smallint [classref boost::random::uniform_smallint uniform_smallint]]
74[def __uniform_int_distribution [classref boost::random::uniform_int_distribution uniform_int_distribution]]
75[def __uniform_01 [classref boost::random::uniform_01 uniform_01]]
76[def __uniform_real_distribution [classref boost::random::uniform_real_distribution uniform_real_distribution]]
77[def __bernoulli_distribution [classref boost::random::bernoulli_distribution bernoulli_distribution]]
78[def __beta_distribution [classref boost::random::beta_distribution beta_distribution]]
79[def __binomial_distribution [classref boost::random::binomial_distribution binomial_distribution]]
80[def __cauchy_distribution [classref boost::random::cauchy_distribution cauchy_distribution]]
81[def __discrete_distribution [classref boost::random::discrete_distribution discrete_distribution]]
82[def __gamma_distribution [classref boost::random::gamma_distribution gamma_distribution]]
83[def __hyperexponential_distribution [classref boost::random::hyperexponential_distribution hyperexponential_distribution]]
84[def __laplace_distribution [classref boost::random::laplace_distribution laplace_distribution]]
85[def __poisson_distribution [classref boost::random::poisson_distribution poisson_distribution]]
86[def __geometric_distribution [classref boost::random::geometric_distribution geometric_distribution]]
87[def __triangle_distribution [classref boost::random::triangle_distribution triangle_distribution]]
88[def __exponential_distribution [classref boost::random::exponential_distribution exponential_distribution]]
89[def __normal_distribution [classref boost::random::normal_distribution normal_distribution]]
90[def __lognormal_distribution [classref boost::random::lognormal_distribution lognormal_distribution]]
91[def __uniform_on_sphere [classref boost::random::uniform_on_sphere uniform_on_sphere]]
92[def __weibull_distribution [classref boost::random::weibull_distribution weibull_distribution]]
93[def __extreme_value_distribution [classref boost::random::extreme_value_distribution extreme_value_distribution]]
94[def __negative_binomial_distribution [classref boost::random::negative_binomial_distribution negative_binomial_distribution]]
95[def __student_t_distribution [classref boost::random::student_t_distribution student_t_distribution]]
96[def __fisher_f_distribution [classref boost::random::fisher_f_distribution fisher_f_distribution]]
97[def __chi_squared_distribution [classref boost::random::chi_squared_distribution chi_squared_distribution]]
98[def __non_central_chi_squared_distribution [classref boost::random::non_central_chi_squared_distribution non_central_chi_squared_distribution]]
99[def __piecewise_constant_distribution [classref boost::random::piecewise_constant_distribution piecewise_constant_distribution]]
100[def __piecewise_linear_distribution [classref boost::random::piecewise_linear_distribution piecewise_linear_distribution]]
101
102[include performance_data.qbk]
103
104[section Introduction]
105
106Random numbers are useful in a variety of applications. The Boost Random
107Number Library (Boost.Random for short) provides a variety of
108[generators generators] and [distributions distributions] to produce
109random numbers having useful properties, such as uniform distribution.
110
111You should read the [concepts concepts documentation] for an introduction and the
112definition of the basic concepts. For a quick start, it may be sufficient
113to have a look at [@boost:/libs/random/example/random_demo.cpp random_demo.cpp].
114
115For a very quick start, here's an example:
116
117  ``[classref boost::random::mt19937]`` rng;         // produces randomness out of thin air
118                                      // see pseudo-random number generators
119  ``[classref boost::random::uniform_int_distribution]<>`` six(1,6);
120                                      // distribution that maps to 1..6
121                                      // see random number distributions
122  int x = six(rng);                   // simulate rolling a die
123
124[endsect]
125
126[section Tutorial]
127[include tutorial.qbk]
128[endsect]
129
130[section Reference]
131
132[section Concepts]
133[include concepts.qbk]
134[endsect]
135
136[section Generators]
137[include generators.qbk]
138[endsect]
139
140[section Distributions]
141[include distributions.qbk]
142[endsect]
143
144[section Utilities]
145[include utilities.qbk]
146[endsect]
147
148[xinclude reference.xml]
149
150[endsect]
151
152[section Performance]
153[include performance.qbk]
154[endsect]
155
156[section History and Acknowledgements]
157
158In November 1999, Jeet Sukumaran proposed a framework based on virtual
159functions, and later sketched a template-based approach. Ed Brey pointed
160out that Microsoft Visual C++ does not support in-class member
161initializations and suggested the enum workaround. Dave Abrahams highlighted
162quantization issues.
163
164The first public release of this random number library materialized in
165March 2000 after extensive discussions on the boost mailing list. Many
166thanks to Beman Dawes for his original min_rand class, portability fixes,
167documentation suggestions, and general guidance. Harry Erwin sent a header
168file which provided additional insight into the requirements. Ed Brey and
169Beman Dawes wanted an iterator-like interface.
170
171Beman Dawes managed the formal review, during which Matthias Troyer,
172Csaba Szepesvari, and Thomas Holenstein gave detailed comments. The
173reviewed version became an official part of boost on 17 June 2000.
174
175Gary Powell contributed suggestions for code cleanliness. Dave Abrahams
176and Howard Hinnant suggested to move the basic generator templates from
177`namespace boost::detail` to `boost::random`.
178
179Ed Brey asked to remove superfluous warnings and helped with `uint64_t`
180handling. Andreas Scherer tested with MSVC. Matthias Troyer contributed
181a [headerref boost/random/lagged_fibonacci.hpp lagged Fibonacci generator].
182Michael Stevens found a bug in the copy semantics of __normal_distribution
183and suggested documentation improvements.
184
185[endsect]
186