pl-nk v0.4.5
Plonk|Plink|Plank are a set of cross-platform C/C++ frameworks for audio software development
Public Member Functions | Static Public Member Functions
RNG Class Reference

Random number generator. More...

Inherits SmartPointerContainer< SmartPointerType, enableWeak >.

List of all members.

Public Member Functions

void seed (const unsigned int value) throw ()
 Seed this random number generator.
unsigned int uniformInt () throw ()
 Generate a random integer.
unsigned int uniform (const unsigned int max) throw ()
 Generate a uniformly distributed random integer between 0 and max-1.
unsigned int uniform (const unsigned int min, const unsigned int max) throw ()
 Generate a uniformly distributed random integer between min and max-1.
int uniform (const int max) throw ()
 Generate a uniformly distributed random integer between 0 and max-1.
int uniform (const int min, const int max) throw ()
 Generate a uniformly distributed random integer between min and max-1.
float uniformFloat () throw ()
 Generate a uniformly distributed random float between 0 and 1.
float uniform (const float max) throw ()
 Generate a uniformly distributed random float between 0 and max.
float uniform (const float min, const float max) throw ()
 Generate a uniformly distributed random float between min and max.
double uniformDouble () throw ()
 Generate a uniformly distributed random double between 0 and 1.
double uniform (const double max) throw ()
 Generate a uniformly distributed random double between 0 and max.
double uniform (const double min, const double max) throw ()
 Generate a uniformly distributed random double between min and max.
float exponential (const float min, const float max) throw ()
 Generate a exponentially distributed random float between min and max.
double exponential (const double min, const double max) throw ()
 Generate a exponentially distributed random double between min and max.

Static Public Member Functions

static RNG & global () throw ()
 Get the global random number generator.
static RNG & audio () throw ()
 Get the audio thread random number generator.

Detailed Description

Random number generator.


Member Function Documentation

RNG & RNG::audio ( ) throw () [static]

Get the audio thread random number generator.

NB This will be no longer sufficient when multicore.

float RNG::exponential ( const float  min,
const float  max 
) throw ()

Generate a exponentially distributed random float between min and max.

double RNG::exponential ( const double  min,
const double  max 
) throw ()

Generate a exponentially distributed random double between min and max.

RNG & RNG::global ( ) throw () [static]

Get the global random number generator.

void RNG::seed ( const unsigned int  value) throw ()

Seed this random number generator.

double RNG::uniform ( const double  max) throw ()

Generate a uniformly distributed random double between 0 and max.

double RNG::uniform ( const double  min,
const double  max 
) throw ()

Generate a uniformly distributed random double between min and max.

int RNG::uniform ( const int  max) throw ()

Generate a uniformly distributed random integer between 0 and max-1.

int RNG::uniform ( const int  min,
const int  max 
) throw ()

Generate a uniformly distributed random integer between min and max-1.

float RNG::uniform ( const float  max) throw ()

Generate a uniformly distributed random float between 0 and max.

unsigned int RNG::uniform ( const unsigned int  min,
const unsigned int  max 
) throw ()

Generate a uniformly distributed random integer between min and max-1.

float RNG::uniform ( const float  min,
const float  max 
) throw ()

Generate a uniformly distributed random float between min and max.

unsigned int RNG::uniform ( const unsigned int  max) throw ()

Generate a uniformly distributed random integer between 0 and max-1.

double RNG::uniformDouble ( ) throw ()

Generate a uniformly distributed random double between 0 and 1.

float RNG::uniformFloat ( ) throw ()

Generate a uniformly distributed random float between 0 and 1.

unsigned int RNG::uniformInt ( ) throw ()

Generate a random integer.


The documentation for this class was generated from the following files:
 All Classes Functions Typedefs Enumerations Enumerator Properties