diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-11-09 18:15:04 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-11-09 18:15:04 +0000 |
commit | 79843b51267d7a8faf8e9dcee09fa5e167373e6d (patch) | |
tree | cc317f202fa6b7b68908af9bee1848355681db78 /src/stable/randombasic.cpp | |
parent | ba177923d7b60800ae2e01f80fc10dc8ad1594bb (diff) | |
download | libbu++-79843b51267d7a8faf8e9dcee09fa5e167373e6d.tar.gz libbu++-79843b51267d7a8faf8e9dcee09fa5e167373e6d.tar.bz2 libbu++-79843b51267d7a8faf8e9dcee09fa5e167373e6d.tar.xz libbu++-79843b51267d7a8faf8e9dcee09fa5e167373e6d.zip |
Added seed parameter to constructor of two PRNGs. Also fixed horrible mistake
in RandomBasic.
Diffstat (limited to 'src/stable/randombasic.cpp')
-rw-r--r-- | src/stable/randombasic.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/stable/randombasic.cpp b/src/stable/randombasic.cpp index e253b70..fe8843b 100644 --- a/src/stable/randombasic.cpp +++ b/src/stable/randombasic.cpp | |||
@@ -7,10 +7,11 @@ | |||
7 | 7 | ||
8 | #include "bu/randombasic.h" | 8 | #include "bu/randombasic.h" |
9 | 9 | ||
10 | Bu::RandomBasic::RandomBasic() : | 10 | #define a (6364136223846793005ll) |
11 | a( 6364136223846793005ll ), | 11 | #define c (1442695040888963407ll) |
12 | c( 1442695040888963407ll ), | 12 | |
13 | x( 0 ) | 13 | Bu::RandomBasic::RandomBasic( int32_t iSeed ) : |
14 | x( iSeed ) | ||
14 | { | 15 | { |
15 | } | 16 | } |
16 | 17 | ||
@@ -20,7 +21,7 @@ Bu::RandomBasic::~RandomBasic() | |||
20 | 21 | ||
21 | void Bu::RandomBasic::seed( int32_t iSeed ) | 22 | void Bu::RandomBasic::seed( int32_t iSeed ) |
22 | { | 23 | { |
23 | c = iSeed; | 24 | x = iSeed; |
24 | } | 25 | } |
25 | 26 | ||
26 | int32_t Bu::RandomBasic::rand() | 27 | int32_t Bu::RandomBasic::rand() |