core: parallel_for_(): update RNG state of the main thread
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user