Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::random::uniform_int_distribution< IntType > Class Template Reference

The class template uniform_int_distribution models a . More...

#include <uniform_int_distribution.hpp>

Inheritance diagram for boost::random::uniform_int_distribution< IntType >:

Classes

class  param_type
 

Public Types

typedef IntType input_type
 
typedef IntType result_type
 

Public Member Functions

 uniform_int_distribution (IntType min_arg=0, IntType max_arg=(std::numeric_limits< IntType >::max)())
 Constructs a uniform_int_distribution. More...
 
 uniform_int_distribution (const param_type &parm)
 Constructs a uniform_int_distribution from its parameters. More...
 
IntType min BOOST_PREVENT_MACRO_SUBSTITUTION () const
 Returns the minimum value of the distribution. More...
 
IntType max BOOST_PREVENT_MACRO_SUBSTITUTION () const
 Returns the maximum value of the distribution. More...
 
IntType a () const
 Returns the minimum value of the distribution. More...
 
IntType b () const
 Returns the maximum value of the distribution. More...
 
param_type param () const
 Returns the parameters of the distribution. More...
 
void param (const param_type &parm)
 Sets the parameters of the distribution. More...
 
void reset ()
 Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. More...
 
template<class Engine >
result_type operator() (Engine &eng) const
 Returns an integer uniformly distributed in the range [min, max]. More...
 
template<class Engine >
result_type operator() (Engine &eng, const param_type &parm) const
 Returns an integer uniformly distributed in the range [param.a(), param.b()]. More...
 
 BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR (os, uniform_int_distribution, ud)
 Writes the distribution to a std::ostream. More...
 
 BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR (is, uniform_int_distribution, ud)
 Reads the distribution from a std::istream. More...
 
 BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR (uniform_int_distribution, lhs, rhs)
 Returns true if the two distributions will produce identical sequences of values given equal generators. More...
 

Detailed Description

template<class IntType = int>
class boost::random::uniform_int_distribution< IntType >

The class template uniform_int_distribution models a .

On each invocation, it returns a random integer value uniformly distributed in the set of integers {min, min+1, min+2, ..., max}.

The template parameter IntType shall denote an integer-like value type.

Member Typedef Documentation

template<class IntType = int>
typedef IntType boost::random::uniform_int_distribution< IntType >::input_type
template<class IntType = int>
typedef IntType boost::random::uniform_int_distribution< IntType >::result_type

Constructor & Destructor Documentation

template<class IntType = int>
boost::random::uniform_int_distribution< IntType >::uniform_int_distribution ( IntType  min_arg = 0,
IntType  max_arg = (std::numeric_limits<IntType>::max)() 
)
inlineexplicit

Constructs a uniform_int_distribution.

min and max are the parameters of the distribution.

Requires: min <= max

References BOOST_ASSERT.

template<class IntType = int>
boost::random::uniform_int_distribution< IntType >::uniform_int_distribution ( const param_type parm)
inlineexplicit

Constructs a uniform_int_distribution from its parameters.

Member Function Documentation

template<class IntType = int>
IntType boost::random::uniform_int_distribution< IntType >::a ( ) const
inline

Returns the minimum value of the distribution.

Referenced by boost::uniform_int< IntType >::param().

template<class IntType = int>
IntType boost::random::uniform_int_distribution< IntType >::b ( ) const
inline

Returns the maximum value of the distribution.

Referenced by boost::uniform_int< IntType >::param().

template<class IntType = int>
IntType min boost::random::uniform_int_distribution< IntType >::BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const
inline

Returns the minimum value of the distribution.

template<class IntType = int>
IntType max boost::random::uniform_int_distribution< IntType >::BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const
inline

Returns the maximum value of the distribution.

template<class IntType = int>
boost::random::uniform_int_distribution< IntType >::BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR ( uniform_int_distribution< IntType >  ,
lhs  ,
rhs   
)
inline

Returns true if the two distributions will produce identical sequences of values given equal generators.

template<class IntType = int>
boost::random::uniform_int_distribution< IntType >::BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR ( is  ,
uniform_int_distribution< IntType >  ,
ud   
)
inline

Reads the distribution from a std::istream.

template<class IntType = int>
boost::random::uniform_int_distribution< IntType >::BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR ( os  ,
uniform_int_distribution< IntType >  ,
ud   
)
inline

Writes the distribution to a std::ostream.

template<class IntType = int>
template<class Engine >
result_type boost::random::uniform_int_distribution< IntType >::operator() ( Engine &  eng) const
inline

Returns an integer uniformly distributed in the range [min, max].

References boost::random::detail::generate_uniform_int().

template<class IntType = int>
template<class Engine >
result_type boost::random::uniform_int_distribution< IntType >::operator() ( Engine &  eng,
const param_type parm 
) const
inline
template<class IntType = int>
param_type boost::random::uniform_int_distribution< IntType >::param ( ) const
inline
template<class IntType = int>
void boost::random::uniform_int_distribution< IntType >::param ( const param_type parm)
inline
template<class IntType = int>
void boost::random::uniform_int_distribution< IntType >::reset ( void  )
inline

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.


The documentation for this class was generated from the following file: