|
SOLUTIONS
|
OPENCLLINK SYMBOL
OpenCLMersenneTwister
OpenCLMersenneTwister[n]
generates n random reals using the Mersenne Twister algorithm.
DetailsDetails
- 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
ExamplesExamplesopen allclose all
Basic Examples (4)Basic Examples (4)
First, load the OpenCLLink application:
| In[1]:= |
This generates 50 random reals:
| In[2]:= |
| Out[2]= | ![]() |
This generates 50 random reals, setting the initial state from a file:
| In[1]:= |
| Out[1]= | ![]() |
This generates 50 random reals, setting the seed value from an integer:
| In[1]:= |
| Out[1]= | ![]() |
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:
| In[1]:= |
| Out[1]= | ![]() |
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »





