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 uniform random number generator engine. For possible types, see [\<random>](../standard-library/random.md).
96
+
72
97
## Remarks
73
-
The class describes a distribution that produces values of type `bool`, distributed according to the Bernoulli distribution discrete probability function. The following table links to articles about individual members.
98
+
The class describes a distribution that produces values of type `bool`, distributed according to the Bernoulli distribution discrete probability function. The following table links to articles about individual members.
The property member `p()` returns the currently stored distribution parameter value `p`.
105
+
The property member `p()` returns the currently stored distribution parameter value `p`.
106
+
107
+
The property member `param()` sets or returns the `param_type` stored distribution parameter package.
108
+
109
+
The `min()` and `max()` member functions return the smallest possible result and largest possible result, respectively.
110
+
111
+
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.
81
112
82
-
For more information about distribution classes and their members, see [\<random>](../standard-library/random.md).
113
+
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.
83
114
84
-
For detailed information about the Bernoulli distribution discrete probability function, see the Wolfram MathWorld article [Bernoulli Distribution](http://go.microsoft.com/fwlink/LinkId=398467).
115
+
For more information about distribution classes and their members, see [\<random>](../standard-library/random.md).
116
+
117
+
For detailed information about the Bernoulli distribution discrete probability function, see the Wolfram MathWorld article [Bernoulli Distribution](http://go.microsoft.com/fwlink/LinkId=398467).
85
118
86
119
## Example
87
120
@@ -131,71 +164,65 @@ int main()
131
164
132
165
test(p_dist, samples);
133
166
}
134
-
135
167
```
136
168
137
-
## Output
138
-
139
-
```
169
+
```Output
140
170
Use CTRL-Z to bypass data entry and run using default values.
141
171
Enter a double value for p distribution (where 0.0 <= p <= 1.0): .45
The parameter structure used to construct the distribution.
196
+
*parm*
197
+
The `param_type` structure used to construct the distribution.
170
198
171
199
### Remarks
172
200
**Precondition:**`0.0 ≤ p ≤ 1.0`
173
201
174
-
The first constructor constructs an object whose stored `p` value holds the value `p`.
175
-
176
-
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.
202
+
The first constructor constructs an object whose stored `p` value holds the value *p*.
177
203
178
-
For more information and a code example, see [binomial_distribution Class](../standard-library/binomial-distribution-class.md).
204
+
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 [bernoulli_distribution Class](../standard-library/bernoulli-distribution-class.md).
219
+
*p*
220
+
The stored `p` distribution parameter.
194
221
195
222
### Remarks
196
-
**Precondition:** `0.0 ≤ p ≤ 1.0`
223
+
**Precondition:**`0.0 ≤ p ≤ 1.0`
197
224
198
-
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.
225
+
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