std::tr1::bernoulli_distribution Class Reference
[Discrete Distributions]
List of all members.
Detailed Description
Generates a sequence of true and false values with likelihood

that true will come up and

that false will appear.
Definition at line 1653 of file random.
Public Types
-
typedef int input_type
-
typedef bool result_type
Public Member Functions
Friends
Constructor & Destructor Documentation
std::tr1::bernoulli_distribution::bernoulli_distribution |
( |
double |
__p = 0.5 |
) |
[inline, explicit] |
Constructs a Bernoulli distribution with likelihood p
.
- Parameters:
-
| __p | [IN] The likelihood of a true result being returned. Must be in the interval . |
Definition at line 1667 of file random.
Member Function Documentation
template<class _UniformRandomNumberGenerator>
result_type std::tr1::bernoulli_distribution::operator() |
( |
_UniformRandomNumberGenerator & |
__urng |
) |
[inline] |
Gets the next value in the Bernoullian sequence.
Definition at line 1693 of file random.
double std::tr1::bernoulli_distribution::p |
( |
|
) |
const [inline] |
Gets the p
parameter of the distribution.
Definition at line 1677 of file random.
void std::tr1::bernoulli_distribution::reset |
( |
|
) |
[inline] |
Resets the distribution state.
Does nothing for a bernoulli distribution.
Definition at line 1686 of file random.
Friends And Related Function Documentation
template<typename _CharT, typename _Traits>
Inserts a bernoulli_distribution random number distribution __x
into the output stream __os
.
- Parameters:
-
| __os | An output stream. |
| __x | A bernoulli_distribution random number distribution. |
- Returns:
- The output stream with the state of
__x
inserted or in an error state.
Definition at line 793 of file random.tcc.
template<typename _CharT, typename _Traits>
Extracts a bernoulli_distribution random number distribution __x
from the input stream __is
.
- Parameters:
-
| __is | An input stream. |
| __x | A bernoulli_distribution random number generator engine. |
- Returns:
- The input stream with
__x
extracted or in an error state.
Definition at line 1726 of file random.
The documentation for this class was generated from the following file: