Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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).
 
double ogdf::randomDoubleExponential (double beta)
 Returns a random double value from the exponential distribution.
 
double ogdf::randomDoubleNormal (double m, double sd)
 Returns a random double value from the normal distribution with mean m and standard deviation sd.
 
int ogdf::randomNumber (int low, int high)
 Returns random integer between low and high (including).
 
long unsigned int ogdf::randomSeed ()
 Returns a random value suitable as initial seed for a random number engine.
 
void ogdf::setSeed (int val)
 Sets the seed for functions like randomSeed(), randomNumber(), randomDouble().
 

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 165 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().