Random number generator that returns a distinct number from the [0,n) interval each time. More...
#include <opencv2/flann/random.h>
Public Member Functions | |
UniqueRandom (int n) | |
Constructor. More... | |
void | init (int n) |
Initializes the number generator. More... | |
int | next () |
Return a distinct random integer in greater or equal to 0 and less than 'n' on each call. More... | |
Random number generator that returns a distinct number from the [0,n) interval each time.
|
inline |
Constructor.
n | Size of the interval from which to generate |
References init().
|
inline |
Initializes the number generator.
n | the size of the interval from which to generate random numbers. |
References cv::randShuffle().
Referenced by UniqueRandom().
|
inline |
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
Referenced by cvflann::KMeansIndex< Distance >::chooseCentersRandom(), and cvflann::random_sample().