This function exists to support use from other
packages that wish to use dust's random number support, and
creates an opaque pointer to a set of random number streams. It
is described more fully in
The name of the generator algorithm used (read-only)
The number of streams of random numbers provided (read-only)
Create a new
dust_rng_pointer$new( seed = NULL, n_streams = 1L, long_jump = 0L, algorithm = "xoshiro256plus" )
The random number seed to use (see dust_rng for details)
The number of independent random number streams to create
Optionally an integer indicating how many "long jumps" should be carried out immediately on creation. This can be used to create a distributed parallel random number generator (see dust_rng_distributed_state)
The random number algorithm to use. The default is
xoshiro256plus which is a good general choice
Synchronise the R copy of the random number state. Typically this is only needed before serialisation if you have ever used the object.
Return a raw vector of state. This can be used to create other generators with the same state.
Return a logical, indicating if the random number
state that would be returned by
state() is "current" (i.e., the
same as the copy held in the pointer) or not. This is
creation or immediately after calling
FALSE after any use of the pointer.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.