#include <vs_random.h>
Definition at line 45 of file vs_random.h.
VSRandom::VSRandom |
( |
unsigned int |
s) | |
|
|
inline |
VSRandom::VSRandom |
( |
unsigned int |
init_key[], |
|
|
unsigned int |
key_length |
|
) |
| |
|
inline |
Definition at line 97 of file vs_random.h.
References i, init_genrand(), j, and k.
103 k = (N() > key_length ? N() : key_length);
105 mt[i] = ( mt[i]^( ( mt[i-1]^(mt[i-1]>>30) )*1664525UL ) )
107 mt[i] &= 0xffffffffUL;
114 if (j >= key_length) j = 0;
116 for (k = N()-1; k; k--) {
117 mt[i] = ( mt[i]^( ( mt[i-1]^(mt[i-1]>>30) )*1566083941UL ) )
119 mt[i] &= 0xffffffffUL;
126 mt[0] = 0x80000000UL;
int VSRandom::genrand_int31 |
( |
void |
) | |
|
|
inline |
unsigned int VSRandom::genrand_int32 |
( |
void |
) | |
|
|
inline |
Definition at line 129 of file vs_random.h.
References init_genrand(), and y.
Referenced by StarSystem::AddUnit(), commandI::dummy(), genrand_int31(), genrand_real1(), genrand_real2(), genrand_real3(), genrand_res53(), AnimatedTexture::LoadAni(), and StarSystem::UpdateUnitPhysics().
132 static unsigned int mag01[2] = {0x0UL, MATRIX_A()};
139 for (kk = 0; kk < N()-M(); kk++) {
140 y = ( mt[kk]&UPPER_MASK() )|( mt[kk+1]&LOWER_MASK() );
141 mt[kk] = mt[kk+M()]^(y>>1)^mag01[y&0x1UL];
143 for (; kk < N()-1; kk++) {
144 y = ( mt[kk]&UPPER_MASK() )|( mt[kk+1]&LOWER_MASK() );
145 mt[kk] = mt[kk+( M()-N() )]^(y>>1)^mag01[y&0x1UL];
147 y = ( mt[N()-1]&UPPER_MASK() )|( mt[0]&LOWER_MASK() );
148 mt[N()-1] = mt[M()-1]^(y>>1)^mag01[y&0x1UL];
154 y ^= (y<<7)&0x9d2c5680UL;
155 y ^= (y<<15)&0xefc60000UL;
double VSRandom::genrand_real1 |
( |
void |
) | |
|
|
inline |
double VSRandom::genrand_real2 |
( |
void |
) | |
|
|
inline |
double VSRandom::genrand_real3 |
( |
void |
) | |
|
|
inline |
double VSRandom::genrand_res53 |
( |
void |
) | |
|
|
inline |
void VSRandom::init_genrand |
( |
unsigned int |
s) | |
|
|
inline |
unsigned int VSRandom::rand |
( |
) | |
|
|
inline |
double VSRandom::uniformExc |
( |
double |
min, |
|
|
double |
max |
|
) |
| |
|
inline |
double VSRandom::uniformInc |
( |
double |
min, |
|
|
double |
max |
|
) |
| |
|
inline |
Definition at line 180 of file vs_random.h.
References genrand_real1(), and min().
Referenced by Orders::FireAt::ChooseTargets(), Unit::EjectCargo(), Orders::FacePerpendicular::FacePerpendicular(), CommunicatingAI::GetRandomUnit(), Orders::LoopAround::LoopAround(), Orders::LoopAroundAgro::LoopAroundAgro(), Orders::FireAt::PossiblySwitchTarget(), GFXSphereVertexList::ProceduralModification(), Orders::FireAt::ReInit(), and NetClient::synchronizeTime().
The documentation for this class was generated from the following file: