A random variate generator is used to join a random number generator together with a random number distribution. More...
#include <variate_generator.hpp>
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_type & | engine () |
Returns: A reference to the associated uniform random number generator. More... | |
const engine_value_type & | engine () const |
Returns: A reference to the associated uniform random number generator. More... | |
distribution_type & | distribution () |
Returns: A reference to the associated . More... | |
const distribution_type & | distribution () 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... | |
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.
typedef Distribution boost::variate_generator< Engine, Distribution >::distribution_type |
typedef Engine boost::variate_generator< Engine, Distribution >::engine_type |
typedef helper_type::value_type boost::variate_generator< Engine, Distribution >::engine_value_type |
typedef Distribution::result_type boost::variate_generator< Engine, Distribution >::result_type |
|
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.
|
inline |
Precondition: distribution().min() is well-formed.
Returns: distribution().min()
|
inline |
Precondition: distribution().max() is well-formed.
Returns: distribution().max()
|
inline |
Returns: A reference to the associated .
|
inline |
Returns: A reference to the associated random distribution.
|
inline |
Returns: A reference to the associated uniform random number generator.
|
inline |
Returns: A reference to the associated uniform random number generator.
|
inline |
Returns: distribution()(engine())
|
inline |
Returns: distribution()(engine(), value).