pack.sprng {rsprng}R Documentation

Return the PRNG state.

Description

pack.sprng returns the state of current active PRNG stream as a vector of integers.

Usage

pack.sprng ()

Value

Return the current PRNG state as an integer vector or NULL if there is no active PRNG stream.

Author(s)

Na (Michael) Li lina@u.washington.edu

References

SPRNG: Scalable Parallel Random Number Generator Library Web Page. http://sprng.cs.fsu.edu/

See Also

unpack.sprng, spawn.sprng

Examples

init.sprng (1, 0, kind = "LCG")
runif (10)
saved <- pack.sprng ()
a1 <- runif (10)
unpack.sprng (saved)
a2 <- runif (10)
all (a1 == a2)
free.sprng ()

[Package Contents]