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/randomcmwc.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 '')
-rw-r--r-- | src/stable/randomcmwc.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stable/randomcmwc.cpp b/src/stable/randomcmwc.cpp index 1d4a913..b1c3cdb 100644 --- a/src/stable/randomcmwc.cpp +++ b/src/stable/randomcmwc.cpp | |||
@@ -11,11 +11,12 @@ | |||
11 | 11 | ||
12 | #define PHI 0x9e3779b9 | 12 | #define PHI 0x9e3779b9 |
13 | 13 | ||
14 | Bu::RandomCmwc::RandomCmwc() : | 14 | Bu::RandomCmwc::RandomCmwc( int32_t iSeed ) : |
15 | q( 0 ), | 15 | q( 0 ), |
16 | c( 362436 ) | 16 | c( 362436 ) |
17 | { | 17 | { |
18 | q = new uint32_t[4096]; | 18 | q = new uint32_t[4096]; |
19 | seed( iSeed ); | ||
19 | } | 20 | } |
20 | 21 | ||
21 | Bu::RandomCmwc::~RandomCmwc() | 22 | Bu::RandomCmwc::~RandomCmwc() |