| 31 | const unsigned long MAX = 32768; |
| 32 | |
| 33 | static unsigned long randgen() |
| 34 | { |
| 35 | myRandomSeed = myRandomSeed * 1103515245 + 12345; |
| 36 | //TODO: What is the purpose of the cast? |
| 37 | unsigned long returnVal = static_cast<unsigned int>(myRandomSeed / 65536) % MAX; |
| 38 | |
| 39 | return returnVal; |
| 40 | } |
| 41 | |
| 42 | //! \brief uniformly distributed number [0;1) |
| 43 | static double uniform() |