11---
2- description : " Learn more about: bernoulli_distribution Class"
32title : " bernoulli_distribution Class"
4- ms.date : " 11/04/2016"
3+ description : " Learn more about: bernoulli_distribution Class"
4+ ms.date : 11/04/2016
55f1_keywords : ["random/std::bernoulli_distribution", "random/std::bernoulli_distribution::reset", "random/std::bernoulli_distribution::p", "random/std::bernoulli_distribution::param", "random/std::bernoulli_distribution::min", "random/std::bernoulli_distribution::max", "random/std::bernoulli_distribution::operator()", "random/std::bernoulli_distribution::param_type", "random/std::bernoulli_distribution::param_type::p", "random/std::bernoulli_distribution::param_type::operator==", "random/std::bernoulli_distribution::param_type::operator!="]
66helpviewer_keywords : ["std::bernoulli_distribution [C++]", "std::bernoulli_distribution [C++], reset", "std::bernoulli_distribution [C++], p", "std::bernoulli_distribution [C++], param", "std::bernoulli_distribution [C++], min", "std::bernoulli_distribution [C++], max", "std::bernoulli_distribution [C++], param_type", "std::bernoulli_distribution [C++], param_type"]
7- ms.assetid : 586bcde1-95ca-411a-bf17-4aaf19482f34
87---
98# bernoulli_distribution Class
109
@@ -14,30 +13,30 @@ Generates a Bernoulli distribution.
1413
1514``` cpp
1615class bernoulli_distribution
17- {
16+ {
1817public:
19- // types
20- typedef bool result_type;
21- struct param_type;
22-
23- // constructors and reset functions
24- explicit bernoulli_distribution(double p = 0.5);
25- explicit bernoulli_distribution(const param_type& parm);
26- void reset();
27-
28- // generating functions
29- template <class URNG >
30- result_type operator()(URNG& gen);
31- template <class URNG >
32- result_type operator()(URNG& gen, const param_type& parm);
33-
34- // property functions
35- double p() const;
36- param_type param() const;
37- void param(const param_type& parm);
38- result_type min() const;
39- result_type max() const;
40- };
18+ // types
19+ typedef bool result_type;
20+ struct param_type;
21+
22+ // constructors and reset functions
23+ explicit bernoulli_distribution(double p = 0.5);
24+ explicit bernoulli_distribution(const param_type& parm);
25+ void reset();
26+
27+ // generating functions
28+ template <class URNG>
29+ result_type operator()(URNG& gen);
30+ template <class URNG>
31+ result_type operator()(URNG& gen, const param_type& parm);
32+
33+ // property functions
34+ double p() const;
35+ param_type param() const;
36+ void param(const param_type& parm);
37+ result_type min() const;
38+ result_type max() const;
39+ };
4140```
4241
4342### Parameters
@@ -161,6 +160,7 @@ The second constructor constructs an object whose stored parameters are initiali
161160
162161Contains the parameters of the distribution.
163162
163+ ```cpp
164164struct param_type {
165165 typedef bernoulli_distribution distribution_type;
166166 param_type(double p = 0.5);
@@ -169,6 +169,7 @@ struct param_type {
169169 bool operator==(const param_type& right) const;
170170 bool operator!=(const param_type& right) const;
171171 };
172+ ```
172173
173174### Parameters
174175
0 commit comments