From 79843b51267d7a8faf8e9dcee09fa5e167373e6d Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 9 Nov 2012 18:15:04 +0000 Subject: Added seed parameter to constructor of two PRNGs. Also fixed horrible mistake in RandomBasic. --- src/stable/randombasic.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/stable/randombasic.cpp') 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 @@ #include "bu/randombasic.h" -Bu::RandomBasic::RandomBasic() : - a( 6364136223846793005ll ), - c( 1442695040888963407ll ), - x( 0 ) +#define a (6364136223846793005ll) +#define c (1442695040888963407ll) + +Bu::RandomBasic::RandomBasic( int32_t iSeed ) : + x( iSeed ) { } @@ -20,7 +21,7 @@ Bu::RandomBasic::~RandomBasic() void Bu::RandomBasic::seed( int32_t iSeed ) { - c = iSeed; + x = iSeed; } int32_t Bu::RandomBasic::rand() -- cgit v1.2.3