libstdc++
|
Public Types | |
typedef _IntType | input_type |
typedef _IntType | result_type |
Public Member Functions | |
result_type | max () const |
result_type | min () const |
template<typename _UniformRandomNumberGenerator > | |
result_type | operator() (_UniformRandomNumberGenerator &__urng) |
template<typename _UniformRandomNumberGenerator > | |
result_type | operator() (_UniformRandomNumberGenerator &__urng, result_type __n) |
void | reset () |
uniform_int (_IntType __min=0, _IntType __max=9) |
Friends | |
template<typename _IntType1 , typename _CharT , typename _Traits > | |
std::basic_ostream< _CharT, _Traits > & | operator<< (std::basic_ostream< _CharT, _Traits > &__os, const uniform_int< _IntType1 > &__x) |
template<typename _IntType1 , typename _CharT , typename _Traits > | |
std::basic_istream< _CharT, _Traits > & | operator>> (std::basic_istream< _CharT, _Traits > &__is, uniform_int< _IntType1 > &__x) |
Uniform discrete distribution for random numbers. A discrete random distribution on the range with equal probability throughout the range.
Definition at line 1560 of file tr1_impl/random.
typedef _IntType std::uniform_int< _IntType >::input_type |
The type of the parameters of the distribution.
Definition at line 1566 of file tr1_impl/random.
typedef _IntType std::uniform_int< _IntType >::result_type |
The type of the range of the distribution.
Definition at line 1568 of file tr1_impl/random.
|
inlineexplicit |
Constructs a uniform distribution object.
Definition at line 1575 of file tr1_impl/random.
|
inline |
Gets the inclusive upper bound of the distribution range.
Definition at line 1592 of file tr1_impl/random.
|
inline |
Gets the inclusive lower bound of the distribution range.
Definition at line 1585 of file tr1_impl/random.
|
inline |
Gets a uniformly distributed random number in the range .
Definition at line 1609 of file tr1_impl/random.
|
inline |
Gets a uniform random number in the range .
This function is aimed at use with std::random_shuffle.
Definition at line 1624 of file tr1_impl/random.
|
inline |
Resets the distribution state.
Does nothing for the uniform integer distribution.
Definition at line 1601 of file tr1_impl/random.
|
friend |
Inserts a uniform_int random number distribution __x
into the output stream os
.
__os | An output stream. |
__x | A uniform_int random number distribution. |
__x
inserted or in an error state.
|
friend |
Extracts a uniform_int random number distribution __x
from the input stream __is
.
__is | An input stream. |
__x | A uniform_int random number generator engine. |
__x
extracted or in an error state.