Skip to content

Commit 99c0d66

Browse files
authored
Merge pull request #126 from stan-dev/new-stan-rng
Add handling for new RNG type in Stan
2 parents 2010d4b + 0deef43 commit 99c0d66

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

R/rstan_config.R

+3-1
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ rstan_config <- function(pkgdir = ".") {
236236
} else {
237237
cppcode <- c("#include <rstan/rstaninc.hpp>", cppcode)
238238
}
239+
rng_type <- ifelse(utils::packageVersion('StanHeaders') >= "2.34",
240+
"stan::rng_t", "boost::ecuyer1988")
239241
if (utils::packageVersion('StanHeaders') >= "2.34") {
240242
cppcode <- gsub("boost::ecuyer1988", "stan::rng_t", cppcode, fixed = TRUE)
241243
}
@@ -278,7 +280,7 @@ rstan_config <- function(pkgdir = ".") {
278280
header = paste0('#include "', hdr_name, '"'),
279281
module = paste0("stan_fit4",
280282
model_name, "_mod"),
281-
CppClass = "rstan::stan_fit<stan_model, boost::random::ecuyer1988> ",
283+
CppClass = paste0("rstan::stan_fit<stan_model, ", rng_type, "> "),
282284
Rfile = FALSE)
283285
)
284286
})

0 commit comments

Comments
 (0)