15 #ifndef __UT_FastRandom__
16 #define __UT_FastRandom__
32 mySeeds[0] = seed ^ 123456789U;
33 for (
int i = 1; i < 4; i++)
36 mySeeds[i] = 1812433253U *
37 (mySeeds[i-1] ^ (mySeeds[i-1] >> 30)) + i;
47 t = mySeeds[0] ^ (mySeeds[0] << 11);
48 mySeeds[0] = mySeeds[1];
49 mySeeds[1] = mySeeds[2];
50 mySeeds[2] = mySeeds[3];
51 mySeeds[3] = (mySeeds[3] ^ (mySeeds[3] >> 19)) ^
60 tmp.
uval = 0x3f800000 | (0x007fffff & urandom());
72 seed = (214013*seed+2531011);
74 return (seed>>16)&0x7FFF;
83 #endif // __UT_FastRandom__
float frandom()
Returns a random float between [0,1).
uint urandom()
Returns a random 32-bit unsigned integer.
int UTfastRand(uint &seed)
IMATH_NAMESPACE::V2f float
float UTfastRandF(uint &seed)
Fast random number generator. Float variant, with values in [0,1).
#define CONST_FPREAL32(c)