You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following example defines two functions: one bound to a string variable, the other bound to a reference of the string variable computed by a call to `ref`. When the value of the variable changes, the first function continues to use the old value and the second function uses the new value.
The floating-point result type, defaults to `double`. For possible types, see [\<random>](../standard-library/random.md).
97
+
*RealType*
98
+
The floating-point result type, defaults to `double`. For possible types, see [\<random>](../standard-library/random.md).
99
+
100
+
*URNG*
101
+
The uniform random number generator engine. For possible types, see [\<random>](../standard-library/random.md).
74
102
75
103
## Remarks
76
-
The template class describes a distribution that produces values of a user-specified integral type, or type `double` if none is provided, distributed according to the Gamma Distribution. The following table links to articles about individual members.
104
+
The template class describes a distribution that produces values of a user-specified floating-point type, or type `double` if none is provided, distributed according to the Gamma Distribution. The following table links to articles about individual members.
The property functions `alpha()` and `beta()` return their respective values for stored distribution parameters `alpha` and `beta`.
111
+
The property functions `alpha()` and `beta()` return their respective values for stored distribution parameters *alpha* and *beta*.
112
+
113
+
The property member `param()` sets or returns the `param_type` stored distribution parameter package.
114
+
115
+
The `min()` and `max()` member functions return the smallest possible result and largest possible result, respectively.
116
+
117
+
The `reset()` member function discards any cached values, so that the result of the next call to `operator()` does not depend on any values obtained from the engine before the call.
84
118
85
-
For more information about distribution classes and their members, see [\<random>](../standard-library/random.md).
119
+
The `operator()` member functions return the next generated value based on the URNG engine, either from the current parameter package, or the specified parameter package.
86
120
87
-
For detailed information about the gamma distribution, see the Wolfram MathWorld article [Gamma Distribution](http://go.microsoft.com/fwlink/LinkId=401111).
121
+
For more information about distribution classes and their members, see [\<random>](../standard-library/random.md).
122
+
123
+
For detailed information about the gamma distribution, see the Wolfram MathWorld article [Gamma Distribution](http://go.microsoft.com/fwlink/LinkId=401111).
88
124
89
125
## Example
90
126
@@ -144,12 +180,9 @@ int main()
144
180
145
181
test(a_dist, b_dist, samples);
146
182
}
147
-
148
183
```
149
184
150
-
## Output
151
-
152
-
```
185
+
```Output
153
186
Use CTRL-Z to bypass data entry and run using default values.
154
187
Enter a floating point value for the 'alpha' distribution parameter (must be greater than zero): 1
155
188
Enter a floating point value for the 'beta' distribution parameter (must be greater than zero): 1
@@ -173,60 +206,66 @@ Distribution for 10 samples:
The parameter structure used to construct the distribution.
228
+
*parm*
229
+
The parameter structure used to construct the distribution.
199
230
200
231
### Remarks
201
-
**Precondition:** `0.0 < alpha` and `0.0 < beta`
232
+
**Precondition:**`0.0 < alpha` and `0.0 < beta`
202
233
203
-
The first constructor constructs an object whose stored `alpha` value holds the value `alpha` and whose stored `beta` value holds the value `beta`.
234
+
The first constructor constructs an object whose stored `alpha` value holds the value *alpha* and whose stored `beta` value holds the value *beta*.
204
235
205
-
The second constructor constructs an object whose stored parameters are initialized from `parm`. You can obtain and set the current parameters of an existing distribution by calling the `param()` member function.
236
+
The second constructor constructs an object whose stored parameters are initialized from *parm*. You can obtain and set the current parameters of an existing distribution by calling the `param()` member function.
See parent topic [gamma_distribution Class](../standard-library/gamma-distribution-class.md).
253
+
*alpha*
254
+
The `alpha` distribution parameter.
255
+
256
+
*beta*
257
+
The `beta` distribution parameter.
258
+
259
+
*right*
260
+
The `param_type` instance to compare this to.
222
261
223
262
### Remarks
224
-
**Precondition:**`0.0 < alpha` and `0.0 < beta`
263
+
**Precondition:** `0.0 < alpha` and `0.0 < beta`
225
264
226
-
This structure can be passed to the distribution's class constructor at instantiation, to the `param()` member function to set the stored parameters of an existing distribution, and to `operator()` to be used in place of the stored parameters.
265
+
This structure can be passed to the distribution's class constructor at instantiation, to the `param()` member function to set the stored parameters of an existing distribution, and to `operator()` to be used in place of the stored parameters.
0 commit comments