From 0deef43857dc707f036d2d8525e41669a4409bbc Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 20 May 2024 21:45:38 +0300 Subject: [PATCH] Add handling for new RNG type in Stan --- R/rstan_config.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/rstan_config.R b/R/rstan_config.R index 87f8750..d697eb3 100644 --- a/R/rstan_config.R +++ b/R/rstan_config.R @@ -236,6 +236,8 @@ rstan_config <- function(pkgdir = ".") { } else { cppcode <- c("#include ", cppcode) } + rng_type <- ifelse(utils::packageVersion('StanHeaders') >= "2.34", + "stan::rng_t", "boost::ecuyer1988") if (utils::packageVersion('StanHeaders') >= "2.34") { cppcode <- gsub("boost::ecuyer1988", "stan::rng_t", cppcode, fixed = TRUE) } @@ -278,7 +280,7 @@ rstan_config <- function(pkgdir = ".") { header = paste0('#include "', hdr_name, '"'), module = paste0("stan_fit4", model_name, "_mod"), - CppClass = "rstan::stan_fit ", + CppClass = paste0("rstan::stan_fit "), Rfile = FALSE) ) })