31#ifndef OPENCV_FLANN_RANDOM_H
32#define OPENCV_FLANN_RANDOM_H
45#ifndef OPENCV_FLANN_USE_STD_RAND
46# if INT_MAX == RAND_MAX
61inline void seed_random(
unsigned int seed)
63#ifndef OPENCV_FLANN_USE_STD_RAND
79inline double rand_double(
double high = 1.0,
double low = 0)
81 return low + ((high-low) * (
rand() / (RAND_MAX + 1.0)));
90inline int rand_int(
int high = RAND_MAX,
int low = 0)
92 return low + (int) (
double(high-low) * (
rand() / (RAND_MAX + 1.0)));
124 for (
int i = 0; i < size_; ++i) vals_[i] = i;
127#ifndef OPENCV_FLANN_USE_STD_RAND
143 if (counter_ == size_) {
147 return vals_[counter_++];
Random Number Generator.
Definition core.hpp:2889
int uniform(int a, int b)
returns uniformly distributed integer random number from [a,b) range
CV_EXPORTS RNG & theRNG()
Returns the default random number generator.
CV_EXPORTS_W void randShuffle(InputOutputArray dst, double iterFactor=1., RNG *rng=0)
Shuffles the array elements randomly.
T random_shuffle(T... args)