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

A random variate generator is used to join a random number generator together with a random number distribution. More...

#include <variate_generator.hpp>

Inheritance diagram for boost::variate_generator< Engine, Distribution >:

Public Types

typedef helper_type::value_type engine_value_type
 
typedef Engine engine_type
 
typedef Distribution distribution_type
 
typedef Distribution::result_type result_type
 

Public Member Functions

 variate_generator (Engine e, Distribution d)
 Constructs a variate_generator object with the associated eng and the associated d. More...
 
result_type operator() ()
 Returns: distribution()(engine()) More...
 
template<class T >
result_type operator() (const T &value)
 Returns: distribution()(engine(), value). More...
 
engine_value_typeengine ()
 Returns: A reference to the associated uniform random number generator. More...
 
const engine_value_typeengine () const
 Returns: A reference to the associated uniform random number generator. More...
 
distribution_typedistribution ()
 Returns: A reference to the associated . More...
 
const distribution_typedistribution () const
 Returns: A reference to the associated random distribution. More...
 
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const
 Precondition: distribution().min() is well-formed. More...
 
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const
 Precondition: distribution().max() is well-formed. More...
 

Detailed Description

template<class Engine, class Distribution>
class boost::variate_generator< Engine, Distribution >

A random variate generator is used to join a random number generator together with a random number distribution.

Boost.Random provides a vast choice of as well as .

The argument for the template parameter Engine shall be of the form U, U&, or U*, where U models a . Then, the member engine_value_type names U (not the pointer or reference to U).

Specializations of variate_generator satisfy the requirements of CopyConstructible. They also satisfy the requirements of Assignable unless the template parameter Engine is of the form U&.

The complexity of all functions specified in this section is constant. No function described in this section except the constructor throws an exception.

Member Typedef Documentation

template<class Engine, class Distribution>
typedef Distribution boost::variate_generator< Engine, Distribution >::distribution_type
template<class Engine, class Distribution>
typedef Engine boost::variate_generator< Engine, Distribution >::engine_type
template<class Engine, class Distribution>
typedef helper_type::value_type boost::variate_generator< Engine, Distribution >::engine_value_type
template<class Engine, class Distribution>
typedef Distribution::result_type boost::variate_generator< Engine, Distribution >::result_type

Constructor & Destructor Documentation

template<class Engine, class Distribution>
boost::variate_generator< Engine, Distribution >::variate_generator ( Engine  e,
Distribution  d 
)
inline

Constructs a variate_generator object with the associated eng and the associated d.

Throws: If and what the copy constructor of Engine or Distribution throws.

Member Function Documentation

template<class Engine, class Distribution>
result_type min boost::variate_generator< Engine, Distribution >::BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const
inline

Precondition: distribution().min() is well-formed.

Returns: distribution().min()

template<class Engine, class Distribution>
result_type max boost::variate_generator< Engine, Distribution >::BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const
inline

Precondition: distribution().max() is well-formed.

Returns: distribution().max()

template<class Engine, class Distribution>
distribution_type& boost::variate_generator< Engine, Distribution >::distribution ( )
inline

Returns: A reference to the associated .

template<class Engine, class Distribution>
const distribution_type& boost::variate_generator< Engine, Distribution >::distribution ( ) const
inline

Returns: A reference to the associated random distribution.

template<class Engine, class Distribution>
engine_value_type& boost::variate_generator< Engine, Distribution >::engine ( )
inline

Returns: A reference to the associated uniform random number generator.

template<class Engine, class Distribution>
const engine_value_type& boost::variate_generator< Engine, Distribution >::engine ( ) const
inline

Returns: A reference to the associated uniform random number generator.

template<class Engine, class Distribution>
result_type boost::variate_generator< Engine, Distribution >::operator() ( )
inline
template<class Engine, class Distribution>
template<class T >
result_type boost::variate_generator< Engine, Distribution >::operator() ( const T value)
inline

Returns: distribution()(engine(), value).


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