.TH "std::bernoulli_distribution" 3cxx "Thu Aug 2 2012" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::bernoulli_distribution \- .SH SYNOPSIS .br .PP .SS "Public Types" .in +1c .ti -1c .RI "typedef int \fBinput_type\fP" .br .ti -1c .RI "typedef bool \fBresult_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBbernoulli_distribution\fP (double __p=0\&.5)" .br .ti -1c .RI "template result_type \fBoperator()\fP (_UniformRandomNumberGenerator &__urng)" .br .ti -1c .RI "double \fBp\fP () const " .br .ti -1c .RI "void \fBreset\fP ()" .br .in -1c .SS "Friends" .in +1c .ti -1c .RI "template \fBstd::basic_ostream\fP< _CharT, .br _Traits > & \fBoperator<<\fP (\fBstd::basic_ostream\fP< _CharT, _Traits > &__os, const \fBbernoulli_distribution\fP &__x)" .br .ti -1c .RI "template \fBstd::basic_istream\fP< _CharT, .br _Traits > & \fBoperator>>\fP (\fBstd::basic_istream\fP< _CharT, _Traits > &__is, \fBbernoulli_distribution\fP &__x)" .br .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\&. .PP Definition at line 1688 of file tr1_impl/random\&. .SH "Constructor & Destructor Documentation" .PP .SS "std::bernoulli_distribution::bernoulli_distribution (double__p = \fC0\&.5\fP)\fC [inline]\fP, \fC [explicit]\fP" 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 .PP Definition at line 1702 of file tr1_impl/random\&. .SH "Member Function Documentation" .PP .SS "template result_type std::bernoulli_distribution::operator() (_UniformRandomNumberGenerator &__urng)\fC [inline]\fP" Gets the next value in the Bernoullian sequence\&. .PP Definition at line 1728 of file tr1_impl/random\&. .SS "double std::bernoulli_distribution::p () const\fC [inline]\fP" Gets the \fCp\fP parameter of the distribution\&. .PP Definition at line 1712 of file tr1_impl/random\&. .SS "void std::bernoulli_distribution::reset ()\fC [inline]\fP" Resets the distribution state\&. .PP Does nothing for a Bernoulli distribution\&. .PP Definition at line 1721 of file tr1_impl/random\&. .SH "Friends And Related Function Documentation" .PP .SS "template \fBstd::basic_ostream\fP<_CharT, _Traits>& operator<< (\fBstd::basic_ostream\fP< _CharT, _Traits > &__os, const \fBbernoulli_distribution\fP &__x)\fC [friend]\fP" Inserts a bernoulli_distribution random number distribution \fC__x\fP into the output stream \fC__os\fP\&. .PP \fBParameters:\fP .RS 4 \fI__os\fP An output stream\&. .br \fI__x\fP A bernoulli_distribution random number distribution\&. .RE .PP \fBReturns:\fP .RS 4 The output stream with the state of \fC__x\fP inserted or in an error state\&. .RE .PP .PP Definition at line 823 of file random\&.tcc\&. .SS "template \fBstd::basic_istream\fP<_CharT, _Traits>& operator>> (\fBstd::basic_istream\fP< _CharT, _Traits > &__is, \fBbernoulli_distribution\fP &__x)\fC [friend]\fP" Extracts a bernoulli_distribution random number distribution \fC__x\fP from the input stream \fC__is\fP\&. .PP \fBParameters:\fP .RS 4 \fI__is\fP An input stream\&. .br \fI__x\fP A bernoulli_distribution random number generator engine\&. .RE .PP \fBReturns:\fP .RS 4 The input stream with \fC__x\fP extracted or in an error state\&. .RE .PP .PP Definition at line 1761 of file tr1_impl/random\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.