Mersenne Twister - 经过修订的C ++实现 [英] Mersenne Twister -- A Revised C++ Implementation
问题描述
我已经修改了Mersenne Twister的修订版C ++实现:
http://www.coyotegulch.com/libcoyote...istedRoad.html
这是免费的 -in-自由"和啤酒中的自由代码。
Mersenne Twister是一个随机数。 Makoto发明的发电机
Matsumoto和Takuji Nishimura;他们的网站包括许多
算法的实现。
基本上,Mersenne Twister是一个非常大的线性反馈移位
寄存器。该算法在19,937位种子上运行,存储在一个32位无符号整数的
624元素数组中。价值2 ^ 19937-1是梅森素数的b
;操纵种子的技术是基于一个较旧的扭曲的方法。算法 - 因此名称为Mersenne Twister。
Mersenne Twister的一个吸引人的方面是它使用二进制
操作 - 而不是耗时的乘法 - 为
生成数字。该算法还具有很长的周期,并且具有良好的b / b
粒度。对于非加密的
应用程序来说,它既快速又有效。
-
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
推荐答案
2004年1月5日星期一13:31:04 GMT,Scott Robert Ladd
< sc *** @ coyotegulch.com>写道:
On Mon, 05 Jan 2004 13:31:04 GMT, Scott Robert Ladd
<sc***@coyotegulch.com> wrote:
我已经修改了我修改过的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的一个吸引人的方面是它使用二进制
操作 - 而不是耗时的乘法 - 用于<生成数字。该算法还具有很长的周期,并且具有良好的粒度。它对于非加密应用程序来说既快速又有效。
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.
新标准库扩展中有一个mersenne twister
草案。它开始提升 - www.boost.org
Tom
C ++ FAQ: http://www.parashift.com/c++-faq-lite/
C常见问题: http://www.eskimo.com/~scs/C-faq/top.html
There is a mersenne twister in the new standard library extension
draft. It started out it boost - www.boost.org
Tom
C++ FAQ: http://www.parashift.com/c++-faq-lite/
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
2004年1月5日星期一15:35:13 +0000,tom_usenet写道:
On Mon, 05 Jan 2004 15:35:13 +0000, tom_usenet wrote:
2004年1月5日星期一13:31:04 GMT ,Scott Robert Ladd
新标准库扩展草案中有一个mersenne twister。它开始提升 - www.boost.org
On Mon, 05 Jan 2004 13:31:04 GMT, Scott Robert Ladd
There is a mersenne twister in the new standard library extension
draft. It started out it boost - www.boost.org
库扩展草案不是任何可用的
编译器的官方部分。虽然可以下载并安装Boost
库,但我知道许多人在使用Boost许可证时遇到了问题
和设计。
多样性很好;我希望Boost好。
-
Scott Robert Ladd
Coyote Gulch Productions( http://www.coyotegulch.com )
高性能计算的软件发明>
" Scott Robert Ladd" < SC *** @ coyotegulch.com>在留言中写道
news:pa **************************** @ coyotegulch.co m ...
"Scott Robert Ladd" <sc***@coyotegulch.com> wrote in message
news: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 does
four table lookups
five shifts
eight bitwise operations
for each number.
Carsten Hansen
这篇关于Mersenne Twister - 经过修订的C ++实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!