Project

General

Profile

BitmapToolkit Scol plugin
DUtils::Random Class Reference

Functions to generate pseudo-random numbers. More...

#include <Random.h>

Classes

class  UnrepeatedRandomizer
 Provides pseudo-random numbers with no repetitions. More...
 

Static Public Member Functions

static void SeedRand ()
 
static void SeedRandOnce ()
 
static void SeedRand (int seed)
 
static void SeedRandOnce (int seed)
 
template<class T >
static T RandomValue ()
 
template<class T >
static T RandomValue (T min, T max)
 
static int RandomInt (int min, int max)
 
template<class T >
static T RandomGaussianValue (T mean, T sigma)
 

Detailed Description

Functions to generate pseudo-random numbers.

Definition at line 21 of file Random.h.

Member Function Documentation

◆ RandomGaussianValue()

template<class T >
static T DUtils::Random::RandomGaussianValue ( mean,
sigma 
)
inlinestatic

Returns a random number from a gaussian distribution

Parameters
mean
sigmastandard deviation

Definition at line 85 of file Random.h.

◆ RandomInt()

int DUtils::Random::RandomInt ( int  min,
int  max 
)
static

Returns a random int in the range [min..max]

Parameters
min
max
Returns
random int in [min..max]

Definition at line 47 of file Random.cpp.

◆ RandomValue() [1/2]

template<class T >
static T DUtils::Random::RandomValue ( )
inlinestatic

Returns a random number in the range [0..1]

Returns
random T number in [0..1]

Definition at line 56 of file Random.h.

◆ RandomValue() [2/2]

template<class T >
static T DUtils::Random::RandomValue ( min,
max 
)
inlinestatic

Returns a random number in the range [min..max]

Parameters
min
max
Returns
random T number in [min..max]

Definition at line 67 of file Random.h.

◆ SeedRand() [1/2]

void DUtils::Random::SeedRand ( )
static

Sets the random number seed to the current time

Definition at line 18 of file Random.cpp.

◆ SeedRand() [2/2]

void DUtils::Random::SeedRand ( int  seed)
static

Sets the given random number seed

Parameters
seed

Definition at line 33 of file Random.cpp.

◆ SeedRandOnce() [1/2]

void DUtils::Random::SeedRandOnce ( )
static

Sets the random number seed to the current time only the first time this function is called

Definition at line 24 of file Random.cpp.

◆ SeedRandOnce() [2/2]

void DUtils::Random::SeedRandOnce ( int  seed)
static

Sets the given random number seed only the first time this function is called

Parameters
seed

Definition at line 38 of file Random.cpp.


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