Class Random

Class Documentation

class Random

Singleton class for generating random numbers.

Public Static Functions

static inline double randomDouble()

Returns a random double number between 0 and 1, uniformally.

Returns:

Random double.

static inline double randomGaussian(double sigma2)

Returns a random Gaussian numbers with mean 0 and custom std.

Parameters:

sigma2 – The sigma (squared) parameter of Guassian distribution.

Returns:

Random double.

static inline int randomInt()

Returns a random integer.

Returns:

Random integer.

static inline void seed(int32_t seed = -1)

Set the seed of all random number generators.

If seed is negative, use a pseudo-random one.

Parameters:

seed – The seed.