diff options
author | dan miller | 2007-10-21 08:36:32 +0000 |
---|---|---|
committer | dan miller | 2007-10-21 08:36:32 +0000 |
commit | 2f8d7092bc2c9609fa98d6888106b96f38b22828 (patch) | |
tree | da6c37579258cc965b52a75aee6135fe44237698 /libraries/ode-0.9/OPCODE/Ice/IceRandom.h | |
parent | * Committing new PolicyManager based on an ACL system. (diff) | |
download | opensim-SC_OLD-2f8d7092bc2c9609fa98d6888106b96f38b22828.zip opensim-SC_OLD-2f8d7092bc2c9609fa98d6888106b96f38b22828.tar.gz opensim-SC_OLD-2f8d7092bc2c9609fa98d6888106b96f38b22828.tar.bz2 opensim-SC_OLD-2f8d7092bc2c9609fa98d6888106b96f38b22828.tar.xz |
libraries moved to opensim-libs, a new repository
Diffstat (limited to 'libraries/ode-0.9/OPCODE/Ice/IceRandom.h')
-rw-r--r-- | libraries/ode-0.9/OPCODE/Ice/IceRandom.h | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/libraries/ode-0.9/OPCODE/Ice/IceRandom.h b/libraries/ode-0.9/OPCODE/Ice/IceRandom.h deleted file mode 100644 index 3170b33..0000000 --- a/libraries/ode-0.9/OPCODE/Ice/IceRandom.h +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
2 | /** | ||
3 | * Contains code for random generators. | ||
4 | * \file IceRandom.h | ||
5 | * \author Pierre Terdiman | ||
6 | * \date August, 9, 2001 | ||
7 | */ | ||
8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
9 | |||
10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
11 | // Include Guard | ||
12 | #ifndef __ICERANDOM_H__ | ||
13 | #define __ICERANDOM_H__ | ||
14 | |||
15 | FUNCTION ICECORE_API void SRand(udword seed); | ||
16 | FUNCTION ICECORE_API udword Rand(); | ||
17 | |||
18 | //! Returns a unit random floating-point value | ||
19 | inline_ float UnitRandomFloat() { return float(Rand()) * ONE_OVER_RAND_MAX; } | ||
20 | |||
21 | //! Returns a random index so that 0<= index < max_index | ||
22 | ICECORE_API udword GetRandomIndex(udword max_index); | ||
23 | |||
24 | class ICECORE_API BasicRandom | ||
25 | { | ||
26 | public: | ||
27 | |||
28 | //! Constructor | ||
29 | inline_ BasicRandom(udword seed=0) : mRnd(seed) {} | ||
30 | //! Destructor | ||
31 | inline_ ~BasicRandom() {} | ||
32 | |||
33 | inline_ void SetSeed(udword seed) { mRnd = seed; } | ||
34 | inline_ udword GetCurrentValue() const { return mRnd; } | ||
35 | inline_ udword Randomize() { mRnd = mRnd * 2147001325 + 715136305; return mRnd; } | ||
36 | |||
37 | private: | ||
38 | udword mRnd; | ||
39 | }; | ||
40 | |||
41 | #endif // __ICERANDOM_H__ | ||
42 | |||