Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CS_RNG_H__
00020 #define __CS_RNG_H__
00021
00045 #include "csextern.h"
00046 #include "cstypes.h"
00047
00058 class CS_CRYSTALSPACE_EXPORT csRandomGen
00059 {
00060 int i97, j97;
00061 float u [98];
00062 float c, cd, cm;
00063
00064 public:
00066 csRandomGen ()
00067 { Initialize (); }
00069 csRandomGen (uint32 iSeed)
00070 { Initialize (iSeed); }
00071
00073 void Initialize ();
00075 void Initialize (uint32 iSeed);
00076
00078 float Get ()
00079 { return RANMAR (); }
00081 uint32 Get (uint32 iLimit);
00082
00084 bool SelfTest ();
00085
00086 private:
00088 void InitRANMAR (uint32 ij, uint32 kl);
00090 float RANMAR ();
00091 };
00092
00093 #endif // __CS_RNG_H__