3.0.0
Freundlich's C++ toolkit
Public Types | Public Member Functions
fcppt::random::variate< Generator, Distribution > Class Template Reference

Detailed Description

template<typename Generator, typename Distribution>
class fcppt::random::variate< Generator, Distribution >

Combines a generator and a distribution.

Combines a generator and a distribution, using the generator to draw elements from the distribution.

Template Parameters
GeneratorMust be a random number generator
DistributionMust be a random number distribution

Public Types

typedef Generator generator
 The generator type. More...
 
typedef Distribution distribution
 The distribution type. More...
 
typedef distribution::result_type result_type
 The result returned by drawing random numbers. More...
 
typedef Distribution::param_type param_type
 

Public Member Functions

 variate (Generator &generator, Distribution const &distribution)
 Constructs a variate object. More...
 
 variate (Generator &generator, param_type const &param)
 Constructs a variate object. More...
 
result_type operator() ()
 Draws a random number. More...
 

Member Typedef Documentation

◆ distribution

template<typename Generator , typename Distribution >
typedef Distribution fcppt::random::variate< Generator, Distribution >::distribution

The distribution type.

◆ generator

template<typename Generator , typename Distribution >
typedef Generator fcppt::random::variate< Generator, Distribution >::generator

The generator type.

◆ param_type

template<typename Generator , typename Distribution >
typedef Distribution::param_type fcppt::random::variate< Generator, Distribution >::param_type

◆ result_type

template<typename Generator , typename Distribution >
typedef distribution::result_type fcppt::random::variate< Generator, Distribution >::result_type

The result returned by drawing random numbers.

Constructor & Destructor Documentation

◆ variate() [1/2]

template<typename Generator , typename Distribution >
fcppt::random::variate< Generator, Distribution >::variate ( Generator &  generator,
Distribution const &  distribution 
)

Constructs a variate object.

Constructs a variate object from generator and distribution.

Parameters
generatorThe generator to use
distributionThe distribution to use

◆ variate() [2/2]

template<typename Generator , typename Distribution >
fcppt::random::variate< Generator, Distribution >::variate ( Generator &  generator,
param_type const &  param 
)

Constructs a variate object.

Constructs a variate object from generator and param, where param is the param_type of Distribution.

Parameters
generatorThe generator to use
paramThe parameters for the distribution

Member Function Documentation

◆ operator()()

template<typename Generator , typename Distribution >
result_type fcppt::random::variate< Generator, Distribution >::operator() ( )

Draws a random number.

Draws a random number from the distribution passing it the generator to use.