" Scott Robert Ladd" < SC *** @ coyotegulch.com>在留言中写道 news:pa **************************** @ coyotegulch.co m ... "Scott Robert Ladd" <sc***@coyotegulch.com> wrote in messagenews:pa****************************@coyotegulch.co m...我已经修改了Mersenne Twister的修订版C ++实现: http://www.coyotegulch.com/libcoyote...istedRoad.html 这是免费 - 作为功​​能于自由"和啤酒中的自由代码。 Mersenne Twister是一个随机数。由Makoto发明的发电机 Matsumoto和Takuji Nishimura;他们的网站包括许多算法的实现。 基本上,Mersenne Twister是一个非常大的线性反馈移位寄存器。该算法在19,937位种子上运行,存储在32位无符号整数的624元素数组中。值2 ^ 19937-1是梅森素数;用于操纵种子的技术基于较旧的扭曲。算法 - 因此名称为Mersenne Twister。 Mersenne Twister的一个吸引人的方面是它使用二进制操作 - 而不是耗时的乘法 - 用于 - Scott Robert Ladd Coyote Gulch Productions( http://www.coyotegulch.com )高性能计算的软件发明 I''ve posted my revised C++ implementation of the Mersenne Twister at: http://www.coyotegulch.com/libcoyote...istedRoad.html This is "free-as-in-liberty" and "free-as-in-beer" code. The Mersenne Twister is a "random number" generator invented by Makoto Matsumoto and Takuji Nishimura; their website includes numerous implementations of the algorithm. Essentially, the Mersenne Twister is a very large linear-feedback shift register. The algorithm operates on a 19,937 bit seed, stored in an 624-element array of 32-bit unsigned integers. The value 2^19937-1 is a Mersenne prime; the technique for manipulating the seed is based on an older "twisting" algorithm -- hence the name "Mersenne Twister". An appealing aspect of the Mersenne Twister is its use of binary operations -- as opposed to time-consuming multiplication -- for generating numbers. The algorithm also has a very long period, and good granularity. It is both fast and effective for non-cryptographic applications. -- Scott Robert Ladd Coyote Gulch Productions (http://www.coyotegulch.com) Software Invention for High-Performance Computing 你的网页上有很多错误。 C / C ++标准没有定义兰特。 乘法在今天的处理器上并不慢。位移是在x86上。 Mersenne Twister相对较慢,因为它确实是四个表查找 五班 八位按位操作 每个号码。 Carsten Hansen Your web page is full of errors. The C/C++ Standard does not define rand.Multiplication is not slow on today''s processors. Bit shifting is on x86.The Mersenne Twister is relative slow because it doesfour table lookupsfive shiftseight bitwise operationsfor each number. Carsten Hansen 这篇关于Mersenne Twister - 经过修订的C ++实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-12 15:37