Methods for Function rstream.resetsubstream and rstream.nextsubstream in Package ‘rstream’
Some subclasses have implmented the concept of substreams. This is especially usefull if two or more streams should be synchronized.
This interface allows to jump to the beginning of the next substream and to reset the stream object to the beginning of the current substream.
1 2 3 4
an "rstream" object.
Methods available for the following "rstream" subclasses:
Josef Leydold firstname.lastname@example.org
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
## create a new rstream object (of subclass rstream.mrg32k3a) s <- new("rstream.mrg32k3a") ## jump to beginning of next substream rstream.nextsubstream(s) ## generate a sample x <- rstream.sample(s,10) ## reset substream rstream.resetsubstream(s) ## the new sample y is identical to x y <- rstream.sample(s,10) if (identical(x,y)) print("x and y are identical samples")