DescriptionAdd additional random number generator.
This adds SkMWCRandom, which generates random numbers using George Marsaglia's multiply-with-carry method. The current linear congruent generator method fails all three of the tuftests suite (http://www.cs.hku.hk/cisc/projects/va/index.htm#download), whereas this one passes all three. Because this stores four values instead of one, it's not possible to return a single seed for getSeed(), so that functionality has been changed to getState() and setState(). The methods nextF() has also been changed to use a faster method of generating numbers in the interval [0,1). Otherwise, the remaining methods are identical.
Patch Set 1 #
Total comments: 4
Patch Set 2 : Cleaned up some interface; fixed initialization #Patch Set 3 : Changed getState/setState to copy constructor and assignment op #
Total comments: 1
Patch Set 4 : Simplified generator; capitalized name of static function #MessagesTotal messages: 7
|