1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Merge pull request #8293 from alalek:update_rng_in_parallel_for

This commit is contained in:
Vadim Pisarevsky
2017-03-02 05:51:01 +00:00
4 changed files with 65 additions and 3 deletions
+2
View File
@@ -2834,6 +2834,8 @@ public:
double gaussian(double sigma);
uint64 state;
bool operator ==(const RNG& other) const;
};
/** @brief Mersenne Twister random number generator
@@ -349,6 +349,8 @@ inline int RNG::uniform(int a, int b) { return a == b ? a : (int)(next(
inline float RNG::uniform(float a, float b) { return ((float)*this)*(b - a) + a; }
inline double RNG::uniform(double a, double b) { return ((double)*this)*(b - a) + a; }
inline bool RNG::operator ==(const RNG& other) const { return state == other.state; }
inline unsigned RNG::next()
{
state = (uint64)(unsigned)state* /*CV_RNG_COEFF*/ 4164903690U + (unsigned)(state >> 32);