OpenCLMersenneTwister
OpenCLMersenneTwister[n]
generates n random reals using the Mersenne Twister algorithm.
更多信息和选项
- The OpenCLLink application must be loaded using Needs["OpenCLLink`"].
- The following options can be given:
-
"Device" Automatic device on which OpenCL computation is performed "Platform" Automatic platform on which OpenCL computation is performed "SeedFile" None file containing the initial state of the random number generator "SeedValue" Automatic seed value for the random number generator; a random integer is used if set to Automatic
范例
打开所有单元关闭所有单元基本范例 (4)
First, load the OpenCLLink application:
This generates 50 random reals:
This generates 50 random reals, setting the initial state from a file:
This generates 50 random reals, setting the seed value from an integer:
This generates 50 random reals, setting the seed value from an integer and the state from a file, returning the same random numbers on each call:
文本
Wolfram Research (2010),OpenCLMersenneTwister,Wolfram 语言函数,https://reference.wolfram.com/language/OpenCLLink/ref/OpenCLMersenneTwister.html.
CMS
Wolfram 语言. 2010. "OpenCLMersenneTwister." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/OpenCLLink/ref/OpenCLMersenneTwister.html.
APA
Wolfram 语言. (2010). OpenCLMersenneTwister. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/OpenCLLink/ref/OpenCLMersenneTwister.html 年