From Jason Turner

[rand.dist.pois]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpdepsf1oh/{from.md → to.md} +39 -51
tmp/tmpdepsf1oh/{from.md → to.md} RENAMED
@@ -2,16 +2,12 @@
2
 
3
  ##### Class template `poisson_distribution` <a id="rand.dist.pois.poisson">[[rand.dist.pois.poisson]]</a>
4
 
5
  A `poisson_distribution` random number distribution produces integer
6
  values i ≥ 0 distributed according to the discrete probability function
7
- $$%
8
- P(i\,|\,\mu)
9
- = \frac{ e^{-\mu} \mu^{i} }
10
- { i\,! }
11
- \; \mbox{.}$$ The distribution parameter μ is also known as this
12
- distribution’s *mean* .
13
 
14
  ``` cpp
15
  template<class IntType = int>
16
  class poisson_distribution
17
  {
@@ -19,11 +15,12 @@ template<class IntType = int>
19
  // types
20
  using result_type = IntType;
21
  using param_type = unspecified;
22
 
23
  // constructors and reset functions
24
- explicit poisson_distribution(double mean = 1.0);
 
25
  explicit poisson_distribution(const param_type& parm);
26
  void reset();
27
 
28
  // generating functions
29
  template<class URBG>
@@ -39,17 +36,16 @@ template<class IntType = int>
39
  result_type max() const;
40
  };
41
  ```
42
 
43
  ``` cpp
44
- explicit poisson_distribution(double mean = 1.0);
45
  ```
46
 
47
- *Requires:* 0 < `mean`.
48
 
49
- *Effects:* Constructs a `poisson_distribution` object; `mean`
50
- corresponds to the parameter of the distribution.
51
 
52
  ``` cpp
53
  double mean() const;
54
  ```
55
 
@@ -58,25 +54,23 @@ constructed.
58
 
59
  ##### Class template `exponential_distribution` <a id="rand.dist.pois.exp">[[rand.dist.pois.exp]]</a>
60
 
61
  An `exponential_distribution` random number distribution produces random
62
  numbers x > 0 distributed according to the probability density function
63
- $$%
64
- p(x\,|\,\lambda)
65
- = \lambda e^{-\lambda x}
66
- \; \mbox{.}$$
67
 
68
  ``` cpp
69
  template<class RealType = double>
70
  class exponential_distribution {
71
  public:
72
  // types
73
  using result_type = RealType;
74
  using param_type = unspecified;
75
 
76
  // constructors and reset functions
77
- explicit exponential_distribution(RealType lambda = 1.0);
 
78
  explicit exponential_distribution(const param_type& parm);
79
  void reset();
80
 
81
  // generating functions
82
  template<class URBG>
@@ -92,17 +86,16 @@ template<class RealType = double>
92
  result_type max() const;
93
  };
94
  ```
95
 
96
  ``` cpp
97
- explicit exponential_distribution(RealType lambda = 1.0);
98
  ```
99
 
100
- *Requires:* 0 < `lambda`.
101
 
102
- *Effects:* Constructs an `exponential_distribution` object; `lambda`
103
- corresponds to the parameter of the distribution.
104
 
105
  ``` cpp
106
  RealType lambda() const;
107
  ```
108
 
@@ -111,26 +104,25 @@ constructed.
111
 
112
  ##### Class template `gamma_distribution` <a id="rand.dist.pois.gamma">[[rand.dist.pois.gamma]]</a>
113
 
114
  A `gamma_distribution` random number distribution produces random
115
  numbers x > 0 distributed according to the probability density function
116
- $$%
117
- p(x\,|\,\alpha,\beta)
118
- = \frac{e^{-x/\beta}}{\beta^{\alpha} \cdot \Gamma(\alpha)}
119
- \, \cdot \, x^{\, \alpha-1}
120
- \; \mbox{.}$$
121
 
122
  ``` cpp
123
  template<class RealType = double>
124
  class gamma_distribution {
125
  public:
126
  // types
127
  using result_type = RealType;
128
  using param_type = unspecified;
129
 
130
  // constructors and reset functions
131
- explicit gamma_distribution(RealType alpha = 1.0, RealType beta = 1.0);
 
132
  explicit gamma_distribution(const param_type& parm);
133
  void reset();
134
 
135
  // generating functions
136
  template<class URBG>
@@ -147,17 +139,17 @@ template<class RealType = double>
147
  result_type max() const;
148
  };
149
  ```
150
 
151
  ``` cpp
152
- explicit gamma_distribution(RealType alpha = 1.0, RealType beta = 1.0);
153
  ```
154
 
155
- *Requires:* 0 < `alpha` and 0 < `beta`.
156
 
157
- *Effects:* Constructs a `gamma_distribution` object; `alpha` and `beta`
158
- correspond to the parameters of the distribution.
159
 
160
  ``` cpp
161
  RealType alpha() const;
162
  ```
163
 
@@ -173,27 +165,26 @@ constructed.
173
 
174
  ##### Class template `weibull_distribution` <a id="rand.dist.pois.weibull">[[rand.dist.pois.weibull]]</a>
175
 
176
  A `weibull_distribution` random number distribution produces random
177
  numbers x ≥ 0 distributed according to the probability density function
178
- $$%
179
- p(x\,|\,a,b)
180
- = \frac{a}{b}
181
  \cdot \left(\frac{x}{b}\right)^{a-1}
182
  \cdot \, \exp\left( -\left(\frac{x}{b}\right)^a\right)
183
- \; \mbox{.}$$
184
 
185
  ``` cpp
186
  template<class RealType = double>
187
  class weibull_distribution {
188
  public:
189
  // types
190
  using result_type = RealType;
191
  using param_type = unspecified;
192
 
193
  // constructor and reset functions
194
- explicit weibull_distribution(RealType a = 1.0, RealType b = 1.0);
 
195
  explicit weibull_distribution(const param_type& parm);
196
  void reset();
197
 
198
  // generating functions
199
  template<class URBG>
@@ -210,17 +201,17 @@ template<class RealType = double>
210
  result_type max() const;
211
  };
212
  ```
213
 
214
  ``` cpp
215
- explicit weibull_distribution(RealType a = 1.0, RealType b = 1.0);
216
  ```
217
 
218
- *Requires:* 0 < `a` and 0 < `b`.
219
 
220
- *Effects:* Constructs a `weibull_distribution` object; `a` and `b`
221
- correspond to the respective parameters of the distribution.
222
 
223
  ``` cpp
224
  RealType a() const;
225
  ```
226
 
@@ -236,28 +227,25 @@ constructed.
236
 
237
  ##### Class template `extreme_value_distribution` <a id="rand.dist.pois.extreme">[[rand.dist.pois.extreme]]</a>
238
 
239
  An `extreme_value_distribution` random number distribution produces
240
  random numbers x distributed according to the probability density
241
- function[^6] $$%
242
- p(x\,|\,a,b)
243
- = \frac{1}{b}
244
- \cdot \exp\left( \frac{a-x}{b}
245
- \,-\, \exp\left(\frac{a-x}{b}\right)
246
- \right)
247
- \; \mbox{.}$$
248
 
249
  ``` cpp
250
  template<class RealType = double>
251
  class extreme_value_distribution {
252
  public:
253
  // types
254
  using result_type = RealType;
255
  using param_type = unspecified;
256
 
257
  // constructor and reset functions
258
- explicit extreme_value_distribution(RealType a = 0.0, RealType b = 1.0);
 
259
  explicit extreme_value_distribution(const param_type& parm);
260
  void reset();
261
 
262
  // generating functions
263
  template<class URBG>
@@ -274,17 +262,17 @@ template<class RealType = double>
274
  result_type max() const;
275
  };
276
  ```
277
 
278
  ``` cpp
279
- explicit extreme_value_distribution(RealType a = 0.0, RealType b = 1.0);
280
  ```
281
 
282
- *Requires:* 0 < `b`.
283
 
284
- *Effects:* Constructs an `extreme_value_distribution` object; `a` and
285
- `b` correspond to the respective parameters of the distribution.
286
 
287
  ``` cpp
288
  RealType a() const;
289
  ```
290
 
 
2
 
3
  ##### Class template `poisson_distribution` <a id="rand.dist.pois.poisson">[[rand.dist.pois.poisson]]</a>
4
 
5
  A `poisson_distribution` random number distribution produces integer
6
  values i ≥ 0 distributed according to the discrete probability function
7
+ $$P(i\,|\,\mu) = \frac{e^{-\mu} \mu^{i}}{i\,!} \text{ .}$$ The
8
+ distribution parameter μ is also known as this distribution’s *mean* .
 
 
 
 
9
 
10
  ``` cpp
11
  template<class IntType = int>
12
  class poisson_distribution
13
  {
 
15
  // types
16
  using result_type = IntType;
17
  using param_type = unspecified;
18
 
19
  // constructors and reset functions
20
+ poisson_distribution() : poisson_distribution(1.0) {}
21
+ explicit poisson_distribution(double mean);
22
  explicit poisson_distribution(const param_type& parm);
23
  void reset();
24
 
25
  // generating functions
26
  template<class URBG>
 
36
  result_type max() const;
37
  };
38
  ```
39
 
40
  ``` cpp
41
+ explicit poisson_distribution(double mean);
42
  ```
43
 
44
+ *Preconditions:* 0 < `mean`.
45
 
46
+ *Remarks:* `mean` corresponds to the parameter of the distribution.
 
47
 
48
  ``` cpp
49
  double mean() const;
50
  ```
51
 
 
54
 
55
  ##### Class template `exponential_distribution` <a id="rand.dist.pois.exp">[[rand.dist.pois.exp]]</a>
56
 
57
  An `exponential_distribution` random number distribution produces random
58
  numbers x > 0 distributed according to the probability density function
59
+ $$p(x\,|\,\lambda) = \lambda e^{-\lambda x} \text{ .}$$
 
 
 
60
 
61
  ``` cpp
62
  template<class RealType = double>
63
  class exponential_distribution {
64
  public:
65
  // types
66
  using result_type = RealType;
67
  using param_type = unspecified;
68
 
69
  // constructors and reset functions
70
+ exponential_distribution() : exponential_distribution(1.0) {}
71
+ explicit exponential_distribution(RealType lambda);
72
  explicit exponential_distribution(const param_type& parm);
73
  void reset();
74
 
75
  // generating functions
76
  template<class URBG>
 
86
  result_type max() const;
87
  };
88
  ```
89
 
90
  ``` cpp
91
+ explicit exponential_distribution(RealType lambda);
92
  ```
93
 
94
+ *Preconditions:* 0 < `lambda`.
95
 
96
+ *Remarks:* `lambda` corresponds to the parameter of the distribution.
 
97
 
98
  ``` cpp
99
  RealType lambda() const;
100
  ```
101
 
 
104
 
105
  ##### Class template `gamma_distribution` <a id="rand.dist.pois.gamma">[[rand.dist.pois.gamma]]</a>
106
 
107
  A `gamma_distribution` random number distribution produces random
108
  numbers x > 0 distributed according to the probability density function
109
+ $$p(x\,|\,\alpha,\beta) =
110
+ \frac{e^{-x/\beta}}{\beta^{\alpha} \cdot \Gamma(\alpha)} \, \cdot \, x^{\, \alpha-1}
111
+ \text{ .}$$
 
 
112
 
113
  ``` cpp
114
  template<class RealType = double>
115
  class gamma_distribution {
116
  public:
117
  // types
118
  using result_type = RealType;
119
  using param_type = unspecified;
120
 
121
  // constructors and reset functions
122
+ gamma_distribution() : gamma_distribution(1.0) {}
123
+ explicit gamma_distribution(RealType alpha, RealType beta = 1.0);
124
  explicit gamma_distribution(const param_type& parm);
125
  void reset();
126
 
127
  // generating functions
128
  template<class URBG>
 
139
  result_type max() const;
140
  };
141
  ```
142
 
143
  ``` cpp
144
+ explicit gamma_distribution(RealType alpha, RealType beta = 1.0);
145
  ```
146
 
147
+ *Preconditions:* 0 < `alpha` and 0 < `beta`.
148
 
149
+ *Remarks:* `alpha` and `beta` correspond to the parameters of the
150
+ distribution.
151
 
152
  ``` cpp
153
  RealType alpha() const;
154
  ```
155
 
 
165
 
166
  ##### Class template `weibull_distribution` <a id="rand.dist.pois.weibull">[[rand.dist.pois.weibull]]</a>
167
 
168
  A `weibull_distribution` random number distribution produces random
169
  numbers x ≥ 0 distributed according to the probability density function
170
+ $$p(x\,|\,a,b) = \frac{a}{b}
 
 
171
  \cdot \left(\frac{x}{b}\right)^{a-1}
172
  \cdot \, \exp\left( -\left(\frac{x}{b}\right)^a\right)
173
+ \text{ .}$$
174
 
175
  ``` cpp
176
  template<class RealType = double>
177
  class weibull_distribution {
178
  public:
179
  // types
180
  using result_type = RealType;
181
  using param_type = unspecified;
182
 
183
  // constructor and reset functions
184
+ weibull_distribution() : weibull_distribution(1.0) {}
185
+ explicit weibull_distribution(RealType a, RealType b = 1.0);
186
  explicit weibull_distribution(const param_type& parm);
187
  void reset();
188
 
189
  // generating functions
190
  template<class URBG>
 
201
  result_type max() const;
202
  };
203
  ```
204
 
205
  ``` cpp
206
+ explicit weibull_distribution(RealType a, RealType b = 1.0);
207
  ```
208
 
209
+ *Preconditions:* 0 < `a` and 0 < `b`.
210
 
211
+ *Remarks:* `a` and `b` correspond to the respective parameters of the
212
+ distribution.
213
 
214
  ``` cpp
215
  RealType a() const;
216
  ```
217
 
 
227
 
228
  ##### Class template `extreme_value_distribution` <a id="rand.dist.pois.extreme">[[rand.dist.pois.extreme]]</a>
229
 
230
  An `extreme_value_distribution` random number distribution produces
231
  random numbers x distributed according to the probability density
232
+ function[^6] $$p(x\,|\,a,b) = \frac{1}{b}
233
+ \cdot \exp\left(\frac{a-x}{b} - \exp\left(\frac{a-x}{b}\right)\right)
234
+ \text{ .}$$
 
 
 
 
235
 
236
  ``` cpp
237
  template<class RealType = double>
238
  class extreme_value_distribution {
239
  public:
240
  // types
241
  using result_type = RealType;
242
  using param_type = unspecified;
243
 
244
  // constructor and reset functions
245
+ extreme_value_distribution() : extreme_value_distribution(0.0) {}
246
+ explicit extreme_value_distribution(RealType a, RealType b = 1.0);
247
  explicit extreme_value_distribution(const param_type& parm);
248
  void reset();
249
 
250
  // generating functions
251
  template<class URBG>
 
262
  result_type max() const;
263
  };
264
  ```
265
 
266
  ``` cpp
267
+ explicit extreme_value_distribution(RealType a, RealType b = 1.0);
268
  ```
269
 
270
+ *Preconditions:* 0 < `b`.
271
 
272
+ *Remarks:* `a` and `b` correspond to the respective parameters of the
273
+ distribution.
274
 
275
  ``` cpp
276
  RealType a() const;
277
  ```
278