spawn.new.sprng {rsprng} | R Documentation |
spawn.new.sprng
generates several new PRNG streams at one pass.
spawn.new.sprng (nstream, seed = 0, kindprng = "default", para = 0)
nstream |
number of new streams to spawn |
seed |
an integer of random number seed. It is not the starting state of the sequence; rather, it is an encoding of the starting state. The same seed for all the streams. Distinct streams are returned. Only the 31 least significant bits of seed are used in determining the initial starting state of the stream. Default value is 0 where the default seed for each random number generator is used |
kindprng |
a character string of the disired kind of parallel random number generator |
para |
additional parameters for the parallel random number
generators. If para is 0, default parameters for each PRNG
are used. When invalid parameter is given, a warning is issued and
the default paramter is used. |
Usually one would call init.sprng
separately for each
process or use spawn.sprng
to spawn new streams from
current stream. spawn.new.sprng
generates new streams
unrelated to the current one (might be even of different type). Unlike
init.sprng
, RNGkind
is not called.
Return an integer matrix with nstream
columns, each column
corresponds to one stream. The number of rows will depend on the type
of the PRNG.
Na (Michael) Li nali@umn.edu
SPRNG: Scalable Parallel Random Number Generator Library Web Page. http://sprng.cs.fsu.edu/
pack.sprng
, unpack.sprng
,
spawn.sprng
prngs <- spawn.new.sprng (3, kind = "MLFG") unpack.sprng (prngs[,2]) RNGkind ("user") runif (10) free.sprng ()