Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Sep 6, 2023
1 parent edddd02 commit 9eb22b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions R/rng_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ as_lecyer_cmrg_seed <- function(seed) {
oseed <- get_random_seed()

## Already a L'Ecuyer-CMRG seed? Then use that as is.
if (!is.na(seed) && seed) {
if (is_lecyer_cmrg_seed(oseed)) return(oseed)
}
#if (!is.na(seed) && seed) {
# if (is_lecyer_cmrg_seed(oseed)) return(oseed)
#}

## Otherwise, generate a random one.
on.exit(set_random_seed(oseed), add = TRUE)
Expand Down
6 changes: 3 additions & 3 deletions tests/rng.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ stopifnot(is_lecyer_cmrg_seed(seed))
set_random_seed(seed = seed)
stopifnot(identical(get_random_seed(), seed))

seed2 <- as_lecyer_cmrg_seed(seed = TRUE)
str(seed2)
stopifnot(identical(seed2, seed))
#seed2 <- as_lecyer_cmrg_seed(seed = TRUE)
#str(seed2)
#stopifnot(identical(seed2, seed))

seed3 <- as_lecyer_cmrg_seed(seed = seed)
str(seed3)
Expand Down

0 comments on commit 9eb22b4

Please sign in to comment.