Random Class Reference

Provides static functionality for generating base random numbers, wrapping around boost::random, shared by all Samplers. More...

#include <Random.h>

List of all members.

Public Types

Typedefs for boost's generator/distribution interface
typedef boost::mt19937 Generator
typedef
boost::normal_distribution
< real_t
NormalDist
typedef
boost::variate_generator
< Generator &, NormalDist
BoostNormalSampler
typedef boost::uniform_real
< real_t
ContUniformDist
typedef
boost::variate_generator
< Generator &, ContUniformDist
BoostContUniformSampler
typedef boost::uniform_int< int > DiscreteUniformDist
typedef
boost::variate_generator
< Generator
&, DiscreteUniformDist
BoostDiscreteUniformSampler
typedef
boost::exponential_distribution
< real_t
ExponentialDist
typedef
boost::variate_generator
< Generator &, ExponentialDist
BoostExponentialSampler
typedef
boost::uniform_on_sphere
< real_t
UniformOnSphereDist
typedef
boost::variate_generator
< Generator
&, UniformOnSphereDist
BoostUniformOnSphereSampler

Static Public Member Functions

Static utility methods
static void init ()
 Initializes the Random library routines; must be called before using any functionality of the Milton random number generators.
static real_t sample (real_t min=0, real_t max=1)
static real_t uniform (real_t min=0, real_t max=1)
static int sampleInt (int min, int max)
static unsigned sampleCDF (const real_t *cdf, unsigned n)
static unsigned sampleNormalizedCDF (const real_t *cdf, unsigned n)

Static Public Attributes

Static boost helper classes
static Generator s_generator


Detailed Description

Provides static functionality for generating base random numbers, wrapping around boost::random, shared by all Samplers.

Author:
travis fischer (fisch0920@gmail.com)

matthew jacobs (jacobs.mh@gmail.com)

Date:
fall 2008

Definition at line 21 of file Random.h.


Member Typedef Documentation

typedef boost::mt19937 Random::Generator

Definition at line 26 of file Random.h.

typedef boost::normal_distribution<real_t> Random::NormalDist

Definition at line 28 of file Random.h.

typedef boost::variate_generator<Generator&, NormalDist > Random::BoostNormalSampler

Definition at line 30 of file Random.h.

typedef boost::uniform_real<real_t> Random::ContUniformDist

Definition at line 32 of file Random.h.

typedef boost::variate_generator<Generator&, ContUniformDist > Random::BoostContUniformSampler

Definition at line 34 of file Random.h.

typedef boost::uniform_int<int> Random::DiscreteUniformDist

Definition at line 36 of file Random.h.

Definition at line 38 of file Random.h.

typedef boost::exponential_distribution<real_t> Random::ExponentialDist

Definition at line 40 of file Random.h.

typedef boost::variate_generator<Generator&, ExponentialDist > Random::BoostExponentialSampler

Definition at line 42 of file Random.h.

typedef boost::uniform_on_sphere<real_t> Random::UniformOnSphereDist

Definition at line 44 of file Random.h.

Definition at line 46 of file Random.h.


Member Function Documentation

static void Random::init (  )  [inline, static]

Initializes the Random library routines; must be called before using any functionality of the Milton random number generators.

Definition at line 57 of file Random.h.

static real_t Random::sample ( real_t  min = 0,
real_t  max = 1 
) [inline, static]

Returns:
a random floating point number inbetween the specified bounds [min, max)

Definition at line 68 of file Random.h.

static real_t Random::uniform ( real_t  min = 0,
real_t  max = 1 
) [inline, static]

Returns:
a random floating point number inbetween the specified bounds [min, max)

Definition at line 79 of file Random.h.

static int Random::sampleInt ( int  min,
int  max 
) [inline, static]

Returns:
a random integer inbetween the specified bounds [min, max)

Definition at line 86 of file Random.h.

static unsigned Random::sampleCDF ( const real_t cdf,
unsigned  n 
) [inline, static]

Returns:
a random index from the cdf given according to the cumulative distribution function

Definition at line 94 of file Random.h.

static unsigned Random::sampleNormalizedCDF ( const real_t cdf,
unsigned  n 
) [inline, static]

Returns:
a random index from the cdf given according to the cumulative distribution function
Note:
assumes the given cdf is already normalized

Definition at line 124 of file Random.h.


Member Data Documentation

Definition at line 145 of file Random.h.


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

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6