std::tr1::uniform_int

NAME

std::tr1::uniform_int -

SYNOPSIS


Detailed Description

template<typename _IntType = int> class std::tr1::uniform_int< _IntType >

Definition at line 1515 of file random.

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, result_type __n)
template<typename _UniformRandomNumberGenerator> result_type operator() (_UniformRandomNumberGenerator &__urng)
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)

Member Typedef Documentation

template<typename _IntType = int> typedef _IntType std::tr1::uniform_int< _IntType >::input_type

The type of the parameters of the distribution.
Definition at line 1521 of file random.

template<typename _IntType = int> typedef _IntType std::tr1::uniform_int< _IntType >::result_type

The type of the range of the distribution.
Definition at line 1523 of file random.

Constructor & Destructor Documentation

template<typename _IntType = int> std::tr1::uniform_int< _IntType >::uniform_int (_IntType __min = 0, _IntType __max = 9) [inline, explicit]

Constructs a uniform distribution object.
Definition at line 1530 of file random.
References _GLIBCXX_DEBUG_ASSERT.

Member Function Documentation

template<typename _IntType = int> result_type std::tr1::uniform_int< _IntType >::max () const [inline]

Gets the inclusive upper bound of the distribution range.
Definition at line 1547 of file random.

template<typename _IntType = int> result_type std::tr1::uniform_int< _IntType >::min () const [inline]

Gets the inclusive lower bound of the distribution range.
Definition at line 1540 of file random.

template<typename _IntType = int> template<typename _UniformRandomNumberGenerator> result_type std::tr1::uniform_int< _IntType >::operator() (_UniformRandomNumberGenerator & __urng, result_type __n) [inline]

Gets a uniform random number in the range $[0, n)$.
This function is aimed at use with std::random_shuffle.
Definition at line 1579 of file random.

template<typename _IntType = int> template<typename _UniformRandomNumberGenerator> result_type std::tr1::uniform_int< _IntType >::operator() (_UniformRandomNumberGenerator & __urng) [inline]

Gets a uniformly distributed random number in the range $(min, max)$.
Definition at line 1564 of file random.

template<typename _IntType = int> void std::tr1::uniform_int< _IntType >::reset () [inline]

Resets the distribution state.
Does nothing for the uniform integer distribution.
Definition at line 1556 of file random.

Friends And Related Function Documentation

template<typename _IntType = int> template<typename _IntType1, typename _CharT, typename _Traits> std::basic_ostream<_CharT, _Traits>& operator<< (std::basic_ostream< _CharT, _Traits > & __os, const uniform_int< _IntType1 > & __x) [friend]

Inserts a uniform_int random number distribution __x into the output stream os.
Parameters:
__os An output stream.
__x A uniform_int random number distribution.
Returns:
The output stream with the state of __x inserted or in an error state.

template<typename _IntType = int> template<typename _IntType1, typename _CharT, typename _Traits> std::basic_istream<_CharT, _Traits>& operator>> (std::basic_istream< _CharT, _Traits > & __is, uniform_int< _IntType1 > & __x) [friend]

Extracts a unform_int random number distribution __x from the input stream __is.
Parameters:
__is An input stream.
__x A uniform_int random number generator engine.
Returns:
The input stream with __x extracted or in an error state.

Author

Generated automatically by Doxygen for libstdc++ from the source code.