--- trunk/OOPSE-2.0/src/math/SeqRandNumGen.cpp 2005/03/02 15:36:14 2076 +++ trunk/OOPSE-2.0/src/math/SeqRandNumGen.cpp 2005/04/15 22:04:00 2204 @@ -1,4 +1,4 @@ - /* +/* * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. * * The University of Notre Dame grants you ("Licensee") a @@ -46,9 +46,9 @@ int SeqRandNumGen::nCreatedRNG_ = 0; -int SeqRandNumGen::nCreatedRNG_ = 0; + int SeqRandNumGen::nCreatedRNG_ = 0; -SeqRandNumGen::SeqRandNumGen( const uint32& oneSeed) { + SeqRandNumGen::SeqRandNumGen( const uint32& oneSeed) { //In order to generate independent random number stream, the actual seed used by random //number generator is the seed passed to the constructor plus the number of random number @@ -56,29 +56,29 @@ SeqRandNumGen::SeqRandNumGen( const uint32& oneSeed) { int newSeed = oneSeed + nCreatedRNG_; mtRand_ = new MTRand(newSeed, 1, 0); ++nCreatedRNG_; -} + } -SeqRandNumGen::SeqRandNumGen() { + SeqRandNumGen::SeqRandNumGen() { //the default seeds generated by MTRand will make sure they are unique mtRand_ = new MTRand(1, 0); ++nCreatedRNG_; -} + } -void SeqRandNumGen::seed( const uint32 oneSeed ) { + void SeqRandNumGen::seed( const uint32 oneSeed ) { int newSeed = oneSeed + nCreatedRNG_; mtRand_->seed(newSeed); ++nCreatedRNG_; -} + } -void SeqRandNumGen::seed() { + void SeqRandNumGen::seed() { mtRand_->seed(); ++nCreatedRNG_; -} + } }