Skip to contents

Interface to the Julia RNG

Usage

set_rng_state(i)

reset_rng_state()

get_rng_state()

set_rng_seed(seed)

get_rng_seed()

Arguments

i

Counter number

seed

Seed

Value

The current seed or counter

Examples

# \donttest{

# RNG initializes to seed=1 counter=0
get_rng_seed()
#> [1] 1
get_rng_state()
#> [1] 0

# setter/getter for RNG counter
set_rng_state(123)
get_rng_state()
#> [1] 123

# setter/getter for RNG seed
set_rng_seed(2)
get_rng_seed()
#> [1] 2

# restore to initial setting (seed=1, counter=0)
set_rng_seed(1)
set_rng_state(0)

# }