Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Random Numbers

Provides random number generators. More...

Functions

double ogdf::randomDouble (double low, double high)
 Returns a random double value from the interval [low, high). More...
 
double ogdf::randomDoubleExponential (double beta)
 Returns a random double value from the exponential distribution. More...
 
double ogdf::randomDoubleNormal (double m, double sd)
 Returns a random double value from the normal distribution with mean m and standard deviation sd. More...
 
int ogdf::randomNumber (int low, int high)
 Returns random integer between low and high (including). More...
 
long unsigned int ogdf::randomSeed ()
 Returns a random value suitable as initial seed for a random number engine. More...
 
void ogdf::setSeed (int val)
 Sets the seed for functions like randomSeed(), randomNumber(), randomDouble(). More...
 

Detailed Description

Provides random number generators.

Function Documentation

◆ randomDouble()

double ogdf::randomDouble ( double  low,
double  high 
)

Returns a random double value from the interval [low, high).

Thread Safety

This functions is thread-safe.

◆ randomDoubleExponential()

double ogdf::randomDoubleExponential ( double  beta)

Returns a random double value from the exponential distribution.

Thread Safety

This functions is thread-safe.

◆ randomDoubleNormal()

double ogdf::randomDoubleNormal ( double  m,
double  sd 
)
inline

Returns a random double value from the normal distribution with mean m and standard deviation sd.

Definition at line 179 of file basic.h.

◆ randomNumber()

int ogdf::randomNumber ( int  low,
int  high 
)

Returns random integer between low and high (including).

Thread Safety

This functions is thread-safe.

◆ randomSeed()

long unsigned int ogdf::randomSeed ( )

Returns a random value suitable as initial seed for a random number engine.

Thread Safety

This functions is thread-safe.

◆ setSeed()

void ogdf::setSeed ( int  val)

Sets the seed for functions like randomSeed(), randomNumber(), randomDouble().