opencv on mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

UniqueRandom Class Reference

UniqueRandom Class Reference

Random number generator that returns a distinct number from the [0,n) interval each time. More...

#include <random.h>

Public Member Functions

 UniqueRandom (int n)
 Constructor.
void init (int n)
 Initializes the number generator.
int next ()
 Return a distinct random integer in greater or equal to 0 and less than 'n' on each call.

Detailed Description

Random number generator that returns a distinct number from the [0,n) interval each time.

Definition at line 81 of file random.h.


Constructor & Destructor Documentation

UniqueRandom ( int  n )

Constructor.

Parameters:
nSize of the interval from which to generate
Returns:

Definition at line 93 of file random.h.


Member Function Documentation

void init ( int  n )

Initializes the number generator.

Parameters:
nthe size of the interval from which to generate random numbers.

Definition at line 102 of file random.h.

int next (  )

Return a distinct random integer in greater or equal to 0 and less than 'n' on each call.

It should be called maximum 'n' times. Returns: a random integer

Definition at line 120 of file random.h.