7 #ifndef _INC_cRandomFloat_H
8 #define _INC_cRandomFloat_H
13 #include "../GrayLibBase.h"
28 virtual double get_RandDouble();
29 virtual float get_RandFloat();
37 return get_RandDouble() * nScale;
45 return get_RandFloat() * nScale;
48 float GetRandFRange(
float fRangeLo,
float fRangeHi);
71 virtual void InitSeed(
const void* pData,
size_t iSize)
override;
72 virtual UINT GetRandUX(UINT nScale)
override;
87 static const int k_N = 351;
88 static const int k_M = 175;
89 static const int k_R = 19;
90 static const int k_TEML = 17;
92 static const DWORD k_RANDOM_MATRIX_A = 0xE4BD75F5;
93 static const DWORD k_RANDOM_TEMB = 0x655E5280;
94 static const DWORD k_RANDOM_TEMC = 0xFFD58000;
97 static const int k_N = 624;
98 static const int k_M = 397;
99 static const int k_R = 31;
100 static const int k_TEML = 18;
102 static const DWORD k_RANDOM_MATRIX_A = 0x9908B0DF;
103 static const DWORD k_RANDOM_TEMB = 0x9D2C5680;
104 static const DWORD k_RANDOM_TEMC = 0xEFC60000;
106 static const int k_TEMU = 11;
107 static const int k_TEMS = 7;
108 static const int k_TEMT = 15;
119 virtual void InitSeed(
const void* pData,
size_t iSize)
override;
120 virtual UINT get_RandUns()
override;
129 static const int k_KK = 17;
130 static const int k_JJ = 10;
131 static const int k_R1 = 13;
132 static const int k_R2 = 9;
137 UINT m_randbuffer[k_KK];
144 virtual void InitSeed(
const void* pData,
size_t iSize)
override;
145 virtual UINT get_RandUns()
override;
148 #ifdef USE_LONG_DOUBLE
159 static const int k_KK = 17;
160 static const int k_JJ = 10;
161 static const int k_R1 = 19;
162 static const int k_R2 = 27;
172 UINT m_randbuffer[k_KK][2];
179 virtual void InitSeed(
const void* pData,
size_t iSize)
override;
180 virtual UINT get_RandUns()
override;
183 #ifdef USE_LONG_DOUBLE
185 class GRAYLIB_LINK cRandomMotherOfAll :
public cRandomFloat
193 cRandomMotherOfAll(
const void* pData,
size_t iSize);
194 virtual ~cRandomMotherOfAll()
197 virtual void InitSeed(
const void* pData,
size_t iSize)
override;
198 virtual double get_RandDouble()
override;
199 virtual UINT GetRandUX(UINT nScale)
override;
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
Definition: cRandomFloat.h:124
virtual ~cRandomBGenerator()
Definition: cRandomFloat.h:141
int m_p2
indexes into buffer
Definition: cRandomFloat.h:136
int m_p1
Definition: cRandomFloat.h:135
Definition: cRandomFloat.h:59
cRandomFloatDef(cRandomDef &def) noexcept
Definition: cRandomFloat.h:66
Definition: cRandomFloat.h:21
double GetRandDX(double nScale)
Definition: cRandomFloat.h:31
UNITTEST_FRIEND(cRandomFloat)
float GetRandFX(float nScale)
Definition: cRandomFloat.h:39
Definition: cRandomFloat.h:76
virtual ~cRandomMersenne()
Definition: cRandomFloat.h:116
Definition: cRandomFloat.h:155
LONG_DOUBLE m_randp1
< used for conversion to float
Definition: cRandomFloat.h:169
virtual ~cRandomWGenerator()
Definition: cRandomFloat.h:176
int m_p2
indexes into buffer
Definition: cRandomFloat.h:166
int m_p1
Definition: cRandomFloat.h:165
Definition: cRandom.h:143
UNITTEST2_PREDEF(cQuadtree)
__DECL_IMPORT cRandomFloatDef g_RandFloat
the global default floating point random number generator.
double LONG_DOUBLE
use double precision
Definition: cRandomFloat.h:151