.TH "std::bernoulli_distribution" 3cxx "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::bernoulli_distribution \- A Bernoulli random number distribution\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Classes" .in +1c .ti -1c .RI "struct \fBparam_type\fP" .br .in -1c .SS "Public Types" .in +1c .ti -1c .RI "\fBtypedef\fP bool \fBresult_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBbernoulli_distribution\fP ()" .br .RI "Constructs a Bernoulli distribution with likelihood 0\&.5\&. " .ti -1c .RI "\fBbernoulli_distribution\fP (\fBconst\fP \fBparam_type\fP &__p)" .br .ti -1c .RI "\fBbernoulli_distribution\fP (double __p)" .br .RI "Constructs a Bernoulli distribution with likelihood \fCp\fP\&. " .ti -1c .RI "template<\fBtypename\fP \fB_ForwardIterator\fP , \fBtypename\fP \fB_UniformRandomNumberGenerator\fP > \fBvoid\fP \fB__generate\fP (\fB_ForwardIterator\fP __f, \fB_ForwardIterator\fP __t, \fB_UniformRandomNumberGenerator\fP &\fB__urng\fP)" .br .ti -1c .RI "template<\fBtypename\fP \fB_ForwardIterator\fP , \fBtypename\fP \fB_UniformRandomNumberGenerator\fP > \fBvoid\fP \fB__generate\fP (\fB_ForwardIterator\fP __f, \fB_ForwardIterator\fP __t, \fB_UniformRandomNumberGenerator\fP &\fB__urng\fP, \fBconst\fP \fBparam_type\fP &__p)" .br .ti -1c .RI "template<\fBtypename\fP \fB_UniformRandomNumberGenerator\fP > \fBvoid\fP \fB__generate\fP (\fBresult_type\fP *__f, \fBresult_type\fP *__t, \fB_UniformRandomNumberGenerator\fP &\fB__urng\fP, \fBconst\fP \fBparam_type\fP &__p)" .br .ti -1c .RI "\fBresult_type\fP \fBmax\fP () \fBconst\fP" .br .RI "Returns the least upper bound value of the distribution\&. " .ti -1c .RI "\fBresult_type\fP \fBmin\fP () \fBconst\fP" .br .RI "Returns the greatest lower bound value of the distribution\&. " .ti -1c .RI "template<\fBtypename\fP \fB_UniformRandomNumberGenerator\fP > \fBresult_type\fP \fBoperator()\fP (\fB_UniformRandomNumberGenerator\fP &\fB__urng\fP)" .br .RI "Generating functions\&. " .ti -1c .RI "template<\fBtypename\fP \fB_UniformRandomNumberGenerator\fP > \fBresult_type\fP \fBoperator()\fP (\fB_UniformRandomNumberGenerator\fP &\fB__urng\fP, \fBconst\fP \fBparam_type\fP &__p)" .br .ti -1c .RI "double \fBp\fP () \fBconst\fP" .br .RI "Returns the \fCp\fP parameter of the distribution\&. " .ti -1c .RI "\fBparam_type\fP \fBparam\fP () \fBconst\fP" .br .RI "Returns the parameter set of the distribution\&. " .ti -1c .RI "\fBvoid\fP \fBparam\fP (\fBconst\fP \fBparam_type\fP &\fB__param\fP)" .br .RI "Sets the parameter set of the distribution\&. " .ti -1c .RI "\fBvoid\fP \fBreset\fP ()" .br .RI "Resets the distribution state\&. " .in -1c .SS "Friends" .in +1c .ti -1c .RI "bool \fBoperator==\fP (\fBconst\fP \fBbernoulli_distribution\fP &\fB__d1\fP, \fBconst\fP \fBbernoulli_distribution\fP &\fB__d2\fP)" .br .RI "Return true if two Bernoulli distributions have the same parameters\&. " .in -1c .SH "Detailed Description" .PP A Bernoulli random number distribution\&. Generates a sequence of true and false values with likelihood $p$ that true will come up and $(1 - p)$ that false will appear\&. .SH "Member Typedef Documentation" .PP .SS "\fBtypedef\fP bool \fBstd::bernoulli_distribution::result_type\fP" The type of the range of the distribution\&. .SH "Constructor & Destructor Documentation" .PP .SS "std::bernoulli_distribution::bernoulli_distribution ()\fC [inline]\fP" .PP Constructs a Bernoulli distribution with likelihood 0\&.5\&. .SS "std::bernoulli_distribution::bernoulli_distribution (double __p)\fC [inline]\fP, \fC [explicit]\fP" .PP Constructs a Bernoulli distribution with likelihood \fCp\fP\&. .PP \fBParameters\fP .RS 4 \fI__p\fP [IN] The likelihood of a true result being returned\&. Must be in the interval $[0, 1]$\&. .RE .PP .SH "Member Function Documentation" .PP .SS "\fBresult_type\fP std::bernoulli_distribution::max () const\fC [inline]\fP" .PP Returns the least upper bound value of the distribution\&. .PP References \fBstd::numeric_limits< _Tp >::max()\fP\&. .SS "\fBresult_type\fP std::bernoulli_distribution::min () const\fC [inline]\fP" .PP Returns the greatest lower bound value of the distribution\&. .PP References \fBstd::numeric_limits< _Tp >::min()\fP\&. .SS "template<\fBtypename\fP \fB_UniformRandomNumberGenerator\fP > \fBresult_type\fP std::bernoulli_distribution::operator() (\fB_UniformRandomNumberGenerator\fP & __urng)\fC [inline]\fP" .PP Generating functions\&. .PP References \fBoperator()()\fP\&. .PP Referenced by \fBoperator()()\fP\&. .SS "double std::bernoulli_distribution::p () const\fC [inline]\fP" .PP Returns the \fCp\fP parameter of the distribution\&. .SS "\fBparam_type\fP std::bernoulli_distribution::param () const\fC [inline]\fP" .PP Returns the parameter set of the distribution\&. .PP Referenced by \fBstd::operator>>()\fP\&. .SS "\fBvoid\fP std::bernoulli_distribution::param (\fBconst\fP \fBparam_type\fP & __param)\fC [inline]\fP" .PP Sets the parameter set of the distribution\&. .PP \fBParameters\fP .RS 4 \fI__param\fP The new parameter set of the distribution\&. .RE .PP .SS "\fBvoid\fP std::bernoulli_distribution::reset ()\fC [inline]\fP" .PP Resets the distribution state\&. Does nothing for a Bernoulli distribution\&. .SH "Friends And Related Symbol Documentation" .PP .SS "bool \fBoperator\fP== (\fBconst\fP \fBbernoulli_distribution\fP & __d1, \fBconst\fP \fBbernoulli_distribution\fP & __d2)\fC [friend]\fP" .PP Return true if two Bernoulli distributions have the same parameters\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.