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

The distribution function uniform_int models a . More...

#include <uniform_int.hpp>

Inheritance diagram for boost::uniform_int< IntType >:
Collaboration diagram for boost::uniform_int< IntType >:

Classes

class  param_type
 

Public Types

typedef IntType input_type
 
typedef IntType result_type
 

Public Member Functions

 uniform_int (IntType min_arg=0, IntType max_arg=9)
 Constructs a uniform_int object. More...
 
 uniform_int (const param_type &parm)
 Constructs a uniform_int distribution from its parameters. 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...
 
template<class Engine >
IntType operator() (Engine &eng) const
 
template<class Engine >
IntType operator() (Engine &eng, const param_type &parm) const
 
template<class Engine >
IntType operator() (Engine &eng, IntType n) const
 
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...
 
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 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::uniform_int< IntType >

The distribution function uniform_int models a .

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

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

This class is deprecated. Please use uniform_int_distribution in new code.

Member Typedef Documentation

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

Constructor & Destructor Documentation

template<class IntType = int>
boost::uniform_int< IntType >::uniform_int ( IntType  min_arg = 0,
IntType  max_arg = 9 
)
inlineexplicit

Constructs a uniform_int object.

min and max are the parameters of the distribution.

Requires: min <= max

template<class IntType = int>
boost::uniform_int< IntType >::uniform_int ( 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
inlineinherited

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
inlineinherited

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
inlineinherited

Returns the minimum value of the distribution.

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

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   
)
inlineinherited

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   
)
inlineinherited

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   
)
inlineinherited

Writes the distribution to a std::ostream.

template<class IntType = int>
template<class Engine >
IntType boost::uniform_int< IntType >::operator() ( Engine &  eng) const
inline
template<class IntType = int>
template<class Engine >
IntType boost::uniform_int< IntType >::operator() ( Engine &  eng,
const param_type parm 
) const
inline
template<class IntType = int>
template<class Engine >
IntType boost::uniform_int< IntType >::operator() ( Engine &  eng,
IntType  n 
) const
inline

References BOOST_ASSERT.

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

Sets the parameters of the distribution.

References boost::random::uniform_int_distribution< IntType >::param().

template<class IntType = int>
void boost::random::uniform_int_distribution< IntType >::param ( const param_type parm)
inlineinherited
template<class IntType = int>
void boost::random::uniform_int_distribution< IntType >::reset ( void  )
inlineinherited

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: