4.6.0
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
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

using generator = Generator
 The generator type.
 
using distribution = Distribution
 The distribution type.
 
using result_type = typename distribution::result_type
 The result returned by drawing random numbers.
 
using generator_reference = fcppt::reference<generator>
 
using param_type = typename Distribution::param_type
 

Public Member Functions

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

Member Typedef Documentation

◆ distribution

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

The distribution type.

◆ generator

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

The generator type.

◆ generator_reference

template<typename Generator , typename Distribution >
using fcppt::random::variate< Generator, Distribution >::generator_reference = fcppt::reference<generator>

◆ param_type

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

◆ result_type

template<typename Generator , typename Distribution >
using fcppt::random::variate< Generator, Distribution >::result_type = typename 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_reference 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_reference 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.