diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-05-04 18:44:53 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-05-04 18:44:53 +0000 |
commit | 55431ec82f1db436938125d9d6169aab79cbd3d3 (patch) | |
tree | af9c31eff2a44efacded45dca5bcb027ffbe743d /src/experimental/randomcmwc.h | |
parent | 3e3f79bc35d94fab81cb31e42d8699a7eee102a4 (diff) | |
download | libbu++-55431ec82f1db436938125d9d6169aab79cbd3d3.tar.gz libbu++-55431ec82f1db436938125d9d6169aab79cbd3d3.tar.bz2 libbu++-55431ec82f1db436938125d9d6169aab79cbd3d3.tar.xz libbu++-55431ec82f1db436938125d9d6169aab79cbd3d3.zip |
Two basic random number generators, Cmwc is supposed to be a pretty good one.
I need to get the base class and singleton interface in place.
Diffstat (limited to 'src/experimental/randomcmwc.h')
-rw-r--r-- | src/experimental/randomcmwc.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/experimental/randomcmwc.h b/src/experimental/randomcmwc.h new file mode 100644 index 0000000..3a05383 --- /dev/null +++ b/src/experimental/randomcmwc.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2012 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | #ifndef BU_RANDOM_CMWC_H | ||
8 | #define BU_RANDOM_CMWC_H | ||
9 | |||
10 | #include <stdint.h> | ||
11 | |||
12 | namespace Bu | ||
13 | { | ||
14 | class RandomCmwc | ||
15 | { | ||
16 | public: | ||
17 | RandomCmwc(); | ||
18 | virtual ~RandomCmwc(); | ||
19 | |||
20 | void seed( int32_t iSeed ); | ||
21 | |||
22 | int32_t rand(); | ||
23 | |||
24 | private: | ||
25 | uint32_t *q, c; | ||
26 | }; | ||
27 | }; | ||
28 | |||
29 | #endif | ||