The Cuik KD-Tree Library


random.h File Reference

Definition of basic randomization functions. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void randomReset ()
 Resets the random seed. More...
 
void randomSet (unsigned int seed)
 Sets the random seed. More...
 
double randomDouble ()
 Returns a random double in the [0,1] interval. More...
 
double randomNormal ()
 Returns a random double acording to a normal distribution. More...
 

Detailed Description

Definition of basic randomization functions.

See Also
random.c.

Definition in file random.h.

Function Documentation

void randomReset ( )

Resets the random seed using the current time so, in principle, the reset is hard to predict.

Definition at line 18 of file random.c.

void randomSet ( unsigned int  seed)

Sets the random to the given value. This is used to get repetitive sequences of random numbers in order to debug mainly.

Parameters
seedThe new random seed.

Definition at line 25 of file random.c.

Referenced by main().

+ Here is the caller graph for this function:

double randomDouble ( )
inline

Returns a random number in the [0,1] interval selected with a uniform distribution.

Returns
A random double in [0,1].

Definition at line 33 of file random.c.

Referenced by randomNormal(), RandomPointInRectangle(), and SampleInKDtree().

+ Here is the caller graph for this function:

double randomNormal ( )

Returns a random number following a normal distribution with mean 0 and standard deviation 1.

Returns
A random double.

Definition at line 38 of file random.c.

References randomDouble().

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: