From ec05778d5718a7912e506764d443a78d6a6179e3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 5 Nov 2012 22:41:51 +0000 Subject: Converted tabs to spaces with tabconv. --- src/stable/randomcmwc.cpp | 58 +++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'src/stable/randomcmwc.cpp') diff --git a/src/stable/randomcmwc.cpp b/src/stable/randomcmwc.cpp index 9f68982..1d4a913 100644 --- a/src/stable/randomcmwc.cpp +++ b/src/stable/randomcmwc.cpp @@ -12,52 +12,52 @@ #define PHI 0x9e3779b9 Bu::RandomCmwc::RandomCmwc() : - q( 0 ), - c( 362436 ) + q( 0 ), + c( 362436 ) { - q = new uint32_t[4096]; + q = new uint32_t[4096]; } Bu::RandomCmwc::~RandomCmwc() { - delete[] q; + delete[] q; } void Bu::RandomCmwc::seed( int32_t iSeed ) { - i = 4095; - c = 362436; + i = 4095; + c = 362436; - Bu::RandomBasic rb; - rb.seed( iSeed ); + Bu::RandomBasic rb; + rb.seed( iSeed ); - for( int j = 0; j < 4096; j++ ) - q[j] = rb.rand(); + for( int j = 0; j < 4096; j++ ) + q[j] = rb.rand(); - c = rb.rand(); + c = rb.rand(); - return; - q[0] = (uint32_t)rb.rand(); - q[1] = (uint32_t)rb.rand() + PHI; - q[2] = (uint32_t)rb.rand() + PHI + PHI; + return; + q[0] = (uint32_t)rb.rand(); + q[1] = (uint32_t)rb.rand() + PHI; + q[2] = (uint32_t)rb.rand() + PHI + PHI; - for (int j = 3; j < 4096; j++) - q[j] = q[j - 3] ^ q[j - 2] ^ PHI ^ j; + for (int j = 3; j < 4096; j++) + q[j] = q[j - 3] ^ q[j - 2] ^ PHI ^ j; } int32_t Bu::RandomCmwc::rand() { - uint64_t t, a = 18782LL; - uint32_t x, r = 0xfffffffe; - i = (i + 1) & 4095; - t = a * q[i] + c; - c = (t >> 32); - x = t + c; - if( x < c ) - { - x++; - c++; - } - return (q[i] = r - x); + uint64_t t, a = 18782LL; + uint32_t x, r = 0xfffffffe; + i = (i + 1) & 4095; + t = a * q[i] + c; + c = (t >> 32); + x = t + c; + if( x < c ) + { + x++; + c++; + } + return (q[i] = r - x); } -- cgit v1.2.3