OpenCV  4.1.1-pre
Open Source Computer Vision
Looking for a C++ dev who knows OpenCV?
I'm looking for work. Hire me!
cvflann::UniqueRandom Class Reference

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...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ UniqueRandom()

cvflann::UniqueRandom::UniqueRandom ( int  n)
inline

Constructor.

Parameters
nSize of the interval from which to generate
Returns

References init().

Here is the call graph for this function:

Member Function Documentation

◆ init()

void cvflann::UniqueRandom::init ( int  n)
inline

Initializes the number generator.

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

References cv::randShuffle().

Referenced by UniqueRandom().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ next()

int cvflann::UniqueRandom::next ( )
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().

Here is the caller graph for this function:

The documentation for this class was generated from the following file: