as per the following, how could I make sure the random seed remains unchanged before and after calling the function?
function f()
rng0 = Random.default_rng() # save the current seed
### section for deterministic randomized algorithm
Random.seed!(123)
xxxxxx
xxxxxxx
###
# ??? how could I restore the seed to rng0 ???
end
Also, if you want determinism in your rands to hold across Julia versions, you probably want to use something like StableRNGs.jl further suggesting that @hendri54’s suggestion is best here.