Skip to content
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
473cfec
switch to JS parser
bgoodri Nov 15, 2020
8427415
move ggplot2 to Imports
bgoodri Nov 16, 2020
9a182b2
Merge remote-tracking branch 'stan/try_2.25' into develop
hsbadr Dec 18, 2020
7dac465
rstan: v8: Don't use the deprecated typed_arrays argument
hsbadr Dec 17, 2020
c91ca56
rstan: Fix CPP system command
hsbadr Dec 17, 2020
763c429
Link upgraded Sundials version 5.5.0
hsbadr Dec 17, 2020
1c41646
Update stan/math headers
hsbadr Dec 17, 2020
8d018a4
Update TBB interface and allow using external lib
hsbadr Dec 17, 2020
6fdf1b8
rstan: Introduce stanc_process helper function
hsbadr Dec 18, 2020
f5596d9
rstan: Fix data parsing from C++ code
hsbadr Dec 18, 2020
f4a7b71
rstan: stanc: Print errors and return code
hsbadr Dec 19, 2020
dcafd7f
rstan: stanc: Make sure that model_name is not NULL
hsbadr Dec 19, 2020
5bf9f69
rstan: Support stan::io::validate_dims
hsbadr Dec 19, 2020
28a1d45
Update DESCRIPTION, bump version, and add contributor
hsbadr Dec 19, 2020
90f7047
Fix (possibly) invalid URLs and use HTTPS
hsbadr Dec 19, 2020
fb8fed3
Fix depsy insecure connection
hsbadr Dec 19, 2020
aebfde3
rstan: Fix no valid constructor error
hsbadr Dec 20, 2020
55f203a
Use model_name in locations_array__
hsbadr Dec 20, 2020
a789851
rstan: Depends on StanHeaders >= 2.25.0
hsbadr Dec 20, 2020
0f90c51
workflows: Install StanHeaders development version
hsbadr Dec 20, 2020
8790a7f
Update stan and math submodules
hsbadr Dec 21, 2020
bca4a1f
Revert "workflows: Install StanHeaders development version"
hsbadr Dec 21, 2020
a8a1e3e
Reorganize directory structure and remove redundant math submodule
hsbadr Dec 21, 2020
283e6de
workflows: Install StanHeaders development version
hsbadr Dec 21, 2020
50244cc
Update StanHeaders build script
hsbadr Dec 21, 2020
3d533ec
rstan: Rcpp: Format C++ code using clang-format
hsbadr Dec 21, 2020
a0d8d2c
Update stan submodule
hsbadr Jan 2, 2021
f09b1b8
Update sundials 5.6.1
hsbadr Jan 2, 2021
f783c7b
GHA: Use actions/cache@v2
hsbadr Jan 2, 2021
89ae3a2
GHA: Use StanHeaders installation script
hsbadr Jan 2, 2021
1b0871a
GHA: Install StanHeaders in a separate step
hsbadr Jan 2, 2021
8c42792
Update StanHeaders installation script
hsbadr Jan 2, 2021
0fb2982
GHA: Do not build StanHeaders vignettes
hsbadr Jan 2, 2021
1ed40ad
GHA: Do not build StanHeaders manual
hsbadr Jan 2, 2021
7eaffca
rstan: Update package dependencies
hsbadr Jan 2, 2021
22fc846
StanHeaders: Update libsundials symlink
hsbadr Jan 2, 2021
665db65
rstan: Depends on ggplot2 >= 3.3.2
hsbadr Jan 2, 2021
4f81b36
Update StanHeaders installation script
hsbadr Jan 2, 2021
b767c58
Update package DESCRIPTION
hsbadr Jan 2, 2021
5a74bca
Move stan submodule inside StanHeaders
hsbadr Jan 5, 2021
2318e01
Update StanHeaders symlinks
hsbadr Jan 5, 2021
df30e9e
StanHeaders: Update cleanup scripts
hsbadr Jan 5, 2021
6eb9c83
StanHeaders: Update and simplicy install-github.R
hsbadr Jan 5, 2021
869c1d3
Update package DESCRIPTION
hsbadr Jan 5, 2021
866818c
Update stan submodule
hsbadr Jan 6, 2021
ac056c1
Update rstan license copyright year
hsbadr Jan 6, 2021
0e715bc
Get rid of TBB_INTERFACE_NEW macro
hsbadr Jan 8, 2021
419c772
Update stan submodule
hsbadr Jan 8, 2021
b500c05
Update stan submodule
hsbadr Jan 13, 2021
ee41b44
rstan: Windows: Fix compilation errors
hsbadr Jan 13, 2021
2506cb1
rstan: Define STRICT_R_HEADERS
hsbadr Jan 13, 2021
0937c64
Update stan submodule
hsbadr Jan 13, 2021
4cbf54d
install_StanHeaders: Reset working directory on exit
hsbadr Jan 13, 2021
d19ed5c
Update rstan plugin CPPFLAGS
hsbadr Jan 13, 2021
2eab6f8
Update stan submodule
hsbadr Jan 13, 2021
b22374d
Update stan submodule
hsbadr Jan 13, 2021
3906b09
Update stan submodule
hsbadr Jan 14, 2021
198d79c
GHA: Artifacts: Build and upload source packages
hsbadr Jan 14, 2021
a0e8468
Update stan submodule
hsbadr Jan 15, 2021
7811ef9
Update stan submodule
hsbadr Jan 16, 2021
f0d73d0
GHA: Artifacts: Separate source packages
hsbadr Jan 16, 2021
17e1c15
GHA: Run package build and upload once
hsbadr Jan 16, 2021
922a0df
Revert "Get rid of TBB_INTERFACE_NEW macro"
hsbadr Jan 16, 2021
0509300
GHA: yaml: Lint R-CMD-check workflows
hsbadr Jan 17, 2021
300fb4d
Update stan submodule
hsbadr Jan 18, 2021
6bf7372
Update package DESCRIPTION
hsbadr Jan 18, 2021
a560faf
Update stan submodule
hsbadr Jan 19, 2021
38034a3
rstan: plugin: Respect RcppParallel flags
hsbadr Jan 19, 2021
0add041
GHA: Build and upload binaries
hsbadr Jan 20, 2021
ade69a1
Welcome Stan 2.26
hsbadr Jan 20, 2021
dfdf213
StanHeaders: Update cleanup scripts
hsbadr Jan 20, 2021
469e057
fix extract_sparse_parts for Matrix 1.3-0
ecmerkle Jan 5, 2021
46cd553
GHA: Fix large StanHeaders binaries
hsbadr Jan 20, 2021
1ffa9e1
rstan: Update headers and support threads_per_chain
hsbadr Jan 20, 2021
555eada
rstan: plugin: Include RcppParallel headers
hsbadr Jan 20, 2021
a1bf13f
rstan: plugin: Force linking RcppParallel TBB libs
hsbadr Jan 20, 2021
ad252c7
stanc: Fix error when file is missing
hsbadr Jan 20, 2021
0c9212c
stanc: Ship locally and fall back online
hsbadr Jan 20, 2021
f62c180
stanc: Minor formatting
hsbadr Jan 21, 2021
bf43adf
stanc: Error if empty or invalid filename
hsbadr Jan 21, 2021
44aca35
stanc: Stop if stanc returns errors
hsbadr Jan 21, 2021
b63972c
stanc: Catch more invalid file cases
hsbadr Jan 21, 2021
bc47926
rstan: Fix and expose threads_per_chain
hsbadr Jan 21, 2021
465cabf
Update NEWS and package DESCRIPTION
hsbadr Jan 23, 2021
594c69c
rstan: stanc: Init TBB only if threads_per_chain > 1
hsbadr Jan 23, 2021
8a77333
Update NEWS and package DESCRIPTION
hsbadr Jan 23, 2021
59e858e
rstan: threads_per_chain defaults to 1
hsbadr Jan 23, 2021
ef742f8
stan: math: Include master headers instead of individual files
hsbadr Jan 25, 2021
b6360c0
DESCRIPTION: Remove the 'Date' field
hsbadr Jan 25, 2021
3aad90c
rstan: threads: Remove the debugging messages
hsbadr Jan 26, 2021
d5280ce
Update stan submodule
hsbadr Jan 26, 2021
dfc1800
Update stan submodule
hsbadr Jan 27, 2021
3cb0934
rstan: stanc.js: Update to stanc3 v2.26.0
hsbadr Jan 27, 2021
da91c52
GHA: Use R-devel and R-oldrel only on Linux runners
hsbadr Jan 27, 2021
427ce8d
Merge remote-tracking branch 'stan/develop' into develop
hsbadr Jan 28, 2021
0228ba1
Update stan submodule
hsbadr Jan 28, 2021
cd0eba0
rstan: Update the path of rethrow_located.hpp
hsbadr Jan 28, 2021
c7dc2a6
Revert "rstan: Update the path of rethrow_located.hpp"
hsbadr Jan 28, 2021
7ae664f
Freeze Stan submodule at tags/v2.26.0
hsbadr Jan 28, 2021
b4503ef
Merge remote branch to resolve conflicts
hsbadr Jan 28, 2021
23a7869
Remove rstan3 directory
jeffreypullin Jan 29, 2021
1f50696
rstan: Linking to BH >= 1.75
hsbadr Feb 4, 2021
72f6aff
StanHeaders: Add OpenCL headers
hsbadr Feb 4, 2021
068c36f
rstan: Remove stanc JS message
hsbadr Feb 5, 2021
aff9f29
rstan: stanc: Expose stanc3 flags
hsbadr Feb 5, 2021
3156fe4
rstan: Fix expose_stan_functions with stanc3
hsbadr Feb 5, 2021
629aac4
rstan: stan_model: Expose stanc3 flags
hsbadr Feb 5, 2021
1858e66
rstan: Update NEWS
hsbadr Feb 5, 2021
5d4c7de
Define USE_STANC3 for StanHeaders 2.26
hsbadr Feb 8, 2021
84d4276
rstan: Define USE_STANC3 at the top of C++ code
hsbadr Feb 8, 2021
cc69333
rstan: Fix warning: USE_STANC3 redefined
hsbadr Feb 8, 2021
24e2e92
Merge remote-tracking branch 'stan/develop' into stan_2.25
hsbadr Feb 8, 2021
3e14fb2
Revert "include tbb headers from RcppParallel"
hsbadr Feb 8, 2021
eff51ec
Update math submodule
hsbadr Feb 18, 2021
af015ed
Bump version number for Stan v2.26.1
hsbadr Feb 18, 2021
626c60b
Update stan submodule
hsbadr Feb 20, 2021
35f48d7
rstan: Depends on StanHeaders 2.26.1
hsbadr Feb 20, 2021
a85ba82
Update stan submodule
hsbadr Mar 1, 2021
82353ae
rstan: Cleanup and update startup messages
hsbadr Mar 1, 2021
43d3256
rstan: Update NEWS
hsbadr Mar 1, 2021
0111b83
rstan: stanc.js: Update to stanc3 v2.26.1
hsbadr Mar 1, 2021
666a676
Update stan submodule
hsbadr Mar 24, 2021
04cd4fe
StanHeaders: Update libsundials symlink
hsbadr Mar 24, 2021
c7e72cc
rstan: Update NEWS
hsbadr Mar 24, 2021
2587032
GHA: Install the development version of RcppParallel
hsbadr Mar 24, 2021
2ee7197
Update stan submodule
hsbadr Mar 24, 2021
56368be
GHA: Set shell for all steps
hsbadr Mar 24, 2021
5907e0a
Update stan submodule
hsbadr Apr 17, 2021
2b33ea7
StanHeaders: Build libsundials_kinsol into libStanHeaders.a
hsbadr Apr 17, 2021
34b5b8f
Update stan submodule
hsbadr Apr 20, 2021
0c2cb19
changes parse_data() for the cpp file to remove trailing double under…
SteveBronder Apr 20, 2021
871c322
update upstream to match 2.25 branch
SteveBronder Apr 20, 2021
6c22e04
update gitmodules
SteveBronder Apr 20, 2021
9ce95d5
Update rstan/rstan/R/misc.R
SteveBronder Apr 20, 2021
d43aeb7
Update stan submodule
hsbadr Apr 20, 2021
36fa553
Merge pull request #1 from SteveBronder/fix/data-checking
hsbadr Apr 20, 2021
9101735
rstan: Update NEWS
hsbadr Apr 20, 2021
cc02cf4
rstan: parse_data: Remove trailing underscores only
hsbadr Apr 20, 2021
0373ff2
Update math submodule
hsbadr May 27, 2021
32cf21d
rstan: Use stanc3 v2.27.0-rc1
hsbadr May 27, 2021
466bf17
Update stan submodule
hsbadr May 31, 2021
8a225e2
rstan: Use stanc3 v2.27.0 (2 June 2021)
hsbadr Jun 3, 2021
7096c3a
Bump version and update dependencies
hsbadr Jun 3, 2021
5db1a98
Update stan submodule
hsbadr Jun 3, 2021
00d0c1b
rstan: Fix variational method checks
hsbadr Jun 3, 2021
bc31bb9
Update stan submodule
hsbadr Jun 4, 2021
b8d0b46
Update stan submodule
hsbadr Jun 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:
- Code: GPLv3 (http://opensource.org/licenses/GPL-3.0)
- Code: GPLv3 (https://opensource.org/licenses/GPL-3.0)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ jobs:
- name: Install dependencies
run: |
remotes::install_deps(pkg = "./rstan/rstan", dependencies = TRUE)
try(system("git submodule update --init --recursive --remote --force"))
try(system("rm -Rf StanHeaders/inst/include/upstream StanHeaders/inst/include/src StanHeaders/inst/include/mathlib StanHeaders/inst/include/stan StanHeaders/inst/include/libsundials"))
try(system("cp -Rpv --remove-destination stan/ StanHeaders/inst/include/upstream"))
try(system("cp -Rpv --remove-destination stan/src StanHeaders/inst/include/src"))
try(system("cp -Rpv --remove-destination stan/lib/stan_math StanHeaders/inst/include/mathlib"))
try(system("cp -Rpv --remove-destination stan/lib/stan_math/stan StanHeaders/inst/include/stan"))
try(system("cp -Rpv --remove-destination stan/lib/stan_math/lib/sundials_5.5.0 StanHeaders/inst/include/libsundials"))
remotes::install_local('StanHeaders', dependencies = TRUE, type = "source")
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

Expand Down
6 changes: 1 addition & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
[submodule "stan"]
path = StanHeaders/inst/include/upstream
path = stan
url = https://github.com/stan-dev/stan.git
ignore = dirty
branch = develop
[submodule "StanHeaders/inst/include/mathlib"]
path = StanHeaders/inst/include/mathlib
url = https://github.com/stan-dev/math.git
branch = develop
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# RStan <img src="rstan/rstan/man/figures/stanlogo.png" align="right" width="120" />

<!-- badges: start -->
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/rstan?color=blue)](http://cran.r-project.org/package=rstan)
[![Downloads](http://cranlogs.r-pkg.org/badges/rstan?color=blue)](http://cran.rstudio.com/package=rstan)
[![Research software impact](http://depsy.org/api/package/cran/rstan/badge.svg)](http://depsy.org/package/r/rstan)
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/rstan?color=blue)](https://cran.r-project.org/package=rstan)
[![Downloads](https://cranlogs.r-pkg.org/badges/rstan?color=blue)](https://cran.rstudio.com/package=rstan)
[![Research software impact](http://depsy.org/api/package/cran/rstan/badge.svg)](https://depsy.org/package/r/rstan)
[![R-CMD-check](https://github.com/stan-dev/rstan/workflows/R-CMD-check/badge.svg)](https://github.com/stan-dev/rstan/actions)
<!-- badges: end -->

**RStan** is the R interface to [Stan](http://mc-stan.org).
**RStan** is the R interface to [Stan](https://mc-stan.org).

### Quick links

* [mc-stan.org/rstan](http://mc-stan.org/rstan) (online RStan documentation, vignettes)
* [Stan documentation](http://mc-stan.org/users/documentation/) (language manual, case studies, and more)
* [Ask a question](http://discourse.mc-stan.org) (Stan Forums on Discourse)
* [mc-stan.org/rstan](https://mc-stan.org/rstan/) (online RStan documentation, vignettes)
* [Stan documentation](https://mc-stan.org/users/documentation/) (language manual, case studies, and more)
* [Ask a question](https://discourse.mc-stan.org) (Stan Forums on Discourse)
* [Open an issue](https://github.com/stan-dev/rstan/issues) (GitHub issues for bug reports, feature requests)


Expand Down
9 changes: 7 additions & 2 deletions StanHeaders/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: StanHeaders
Date: 2020-12-09
Date: 2020-12-20
Title: C++ Header Files for Stan
Authors@R: c(person("Ben",family="Goodrich", email="[email protected]", role=c('cre','aut')),
person("Joshua", "Pritikin", role = "ctb"),
Expand All @@ -24,6 +24,9 @@ Authors@R: c(person("Ben",family="Goodrich", email="[email protected]
person("Dustin", "Tran", role = "aut"),
person("Michael", "Malecki", role = "aut"),
person("Yuanjun", "Gao", role = "aut"),
person("Hamada S.", "Badr", role = c("ctb"),
email = "[email protected]",
comment = c(ORCID = "0000-0002-9808-2344")),
person("Trustees of", "Columbia University", role = "cph"),
person("Lawrence Livermore", "National Security", role = "cph", comment = "CVODES"),
person("The Regents of the", "University of California", role = "cph", comment = "CVODES"),
Expand All @@ -36,5 +39,7 @@ LinkingTo: RcppEigen, RcppParallel (>= 5.0.1)
VignetteBuilder: knitr
SystemRequirements: pandoc
Depends: R (>= 3.4.0)
Version: 2.21.0-7
Version: 2.25.0.9000
License: BSD_3_clause + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.1.1
24 changes: 20 additions & 4 deletions StanHeaders/R/Flags.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
CxxFlags <- function(as_character = FALSE) {
TBB <- system.file("include", package = "RcppParallel", mustWork = TRUE)
CXXFLAGS <- paste0("-I", shQuote(TBB), " -D_REENTRANT -DSTAN_THREADS")
if (dir.exists(Sys.getenv("TBB_INC"))) {
TBB_INC <- normalizePath(Sys.getenv("TBB_INC"))
} else {
TBB_INC <- system.file("include", package = "RcppParallel", mustWork = TRUE)
}

if (file.exists(file.path(TBB_INC, "tbb", "version.h"))) {
CXXFLAGS <- paste0("-I", shQuote(TBB_INC), " -D_REENTRANT -DSTAN_THREADS -DTBB_INTERFACE_NEW")
} else {
CXXFLAGS <- paste0("-I", shQuote(TBB_INC), " -D_REENTRANT -DSTAN_THREADS")
}

if (isTRUE(as_character)) return(CXXFLAGS)
cat(CXXFLAGS, " ")
return(invisible(NULL))
}

LdFlags <- function(as_character = FALSE) {
TBB <- system.file("lib", .Platform$r_arch, package = "RcppParallel", mustWork = TRUE)
PKG_LIBS <- paste0("-L", shQuote(TBB), " -Wl,-rpath,", TBB, " -ltbb -ltbbmalloc")
if (dir.exists(Sys.getenv("TBB_LIB"))) {
TBB_LIB <- normalizePath(Sys.getenv("TBB_LIB"))
} else {
TBB_LIB <- system.file("lib", .Platform$r_arch, package = "RcppParallel", mustWork = TRUE)
}

PKG_LIBS <- paste0("-L", shQuote(TBB_LIB), " -Wl,-rpath,", TBB_LIB, " -ltbb -ltbbmalloc")

if (isTRUE(as_character)) return(PKG_LIBS)
cat(PKG_LIBS, " ")
return(invisible(NULL))
Expand Down
2 changes: 1 addition & 1 deletion StanHeaders/inst/include/libsundials
1 change: 0 additions & 1 deletion StanHeaders/inst/include/mathlib
Submodule mathlib deleted from 520cde
1 change: 1 addition & 0 deletions StanHeaders/inst/include/mathlib
2 changes: 1 addition & 1 deletion StanHeaders/inst/include/src
2 changes: 1 addition & 1 deletion StanHeaders/inst/include/stan
1 change: 0 additions & 1 deletion StanHeaders/inst/include/upstream
Submodule upstream deleted from 014cd0
1 change: 1 addition & 0 deletions StanHeaders/inst/include/upstream
6 changes: 3 additions & 3 deletions StanHeaders/install-github.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ install_StanHeaders <- function(rstan_branch = "develop",
math_branch = "master",
library_branch = "master") {
path_rstan <- tempfile(pattern = "git2r-")
git2r::clone("http://github.com/stan-dev/rstan", path_rstan, branch = rstan_branch)
git2r::clone("http://github.com/stan-dev/stan",
git2r::clone("https://github.com/stan-dev/rstan", path_rstan, branch = rstan_branch)
git2r::clone("https://github.com/stan-dev/stan",
file.path(path_rstan, "StanHeaders", "inst", "include", "upstream"),
branch = library_branch)
git2r::clone("http://github.com/stan-dev/math",
git2r::clone("https://github.com/stan-dev/math",
file.path(path_rstan, "StanHeaders", "inst", "include", "mathlib"),
branch = math_branch)
# writeLines(c(".PHONY: static", readLines(file.path(path_rstan, "StanHeaders", "src", "Makevars.win")),
Expand Down
4 changes: 2 additions & 2 deletions licenses/rstan-license.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All rights reserved.


RStan is licensed under the GPLv3 license.
http://opensource.org/licenses/GPL-3.0
https://opensource.org/licenses/GPL-3.0

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -17,5 +17,5 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.

2 changes: 1 addition & 1 deletion rstan/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ install_rstan <- function() {
if(inherits(test, "try-error")) stop("hello world failed; ask for help on Rcpp list")

options(repos = c(getOption("repos"),
rstan = "http://rstan.org/repo/"))
rstan = "https://rstan.org/repo/"))
install.packages("rstan", type = 'source')
library(rstan)
set_cppo("fast")
Expand Down
2 changes: 1 addition & 1 deletion rstan/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ help:
.PHONY: build check install clean clean-all install_pre_rpkg test-R example_csv

install_pre_rpkg:
@R -q -e "options(repos=structure(c(CRAN = 'http://cran.rstudio.com'))); for (pkg in c('inline', 'Rcpp', 'RcppEigen', 'RUnit', 'BH', 'StanHeaders', 'RInside')) if (!require(pkg, character.only = TRUE)) install.packages(pkg, dep = TRUE); sessionInfo()"
@R -q -e "options(repos=structure(c(CRAN = 'https://cran.rstudio.com'))); for (pkg in c('inline', 'Rcpp', 'RcppEigen', 'RUnit', 'BH', 'StanHeaders', 'RInside')) if (!require(pkg, character.only = TRUE)) install.packages(pkg, dep = TRUE); sessionInfo()"

build $(STANPKG): ./rstan/DESCRIPTION
ifeq ($(GIT),)
Expand Down
24 changes: 13 additions & 11 deletions rstan/rstan/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
Package: rstan
Encoding: UTF-8
Type: Package
Title: R Interface to Stan
Version: 2.21.3
Date: 2020-09-01
Version: 2.25.0.9000
Date: 2020-12-20
Authors@R: c(person("Jiqiang", "Guo", email = "[email protected]", role = "aut"),
person("Jonah", "Gabry", email = "[email protected]", role = "aut"),
person("Ben", "Goodrich", email = "[email protected]", role = c("cre", "aut")),
person("Sebastian", "Weber", email = "[email protected]", role = "aut"),
person("Daniel", "Lee", role = "ctb"),
person("Krzysztof", "Sakrejda", role = "ctb"),
person("Modrak", "Martin", role = "ctb"),
person("Hamada S.", "Badr", role = c("ctb"),
email = "[email protected]",
comment = c(ORCID = "0000-0002-9808-2344")),
person("Trustees of", "Columbia University", role = "cph"),
person("Oleg", "Sklyar", role = "cph", comment = "R/cxxfunplus.R"),
person("The R", "Core Team", role = "cph", comment = "R/pairs.R, R/dynGet.R"),
Expand Down Expand Up @@ -40,15 +42,15 @@ Imports:
RcppParallel (>= 5.0.1),
loo (>= 2.3.0),
pkgbuild,
V8
V8 (>= 3.4.0),
ggplot2 (>= 3.0.0)
Depends:
R (>= 3.4.0),
StanHeaders (>= 2.21.0),
ggplot2 (>= 3.0.0)
StanHeaders (>= 2.25.0)
LinkingTo: Rcpp (>= 0.12.0),
RcppEigen (>= 0.3.3.3.0),
BH (>= 1.72.0-2),
StanHeaders (>= 2.21.0),
StanHeaders (>= 2.25.0),
RcppParallel
Suggests:
RUnit,
Expand All @@ -62,10 +64,10 @@ Suggests:
rstantools,
rstudioapi,
Matrix,
knitr (>= 1.15.1),
V8
URL: https://mc-stan.org/rstan, https://discourse.mc-stan.org
knitr (>= 1.15.1)
URL: https://mc-stan.org/rstan/, https://discourse.mc-stan.org
BugReports: https://github.com/stan-dev/rstan/issues/
VignetteBuilder: knitr
SystemRequirements: GNU make, pandoc
RoxygenNote: 5.0.1
Encoding: UTF-8
RoxygenNote: 7.1.1
2 changes: 1 addition & 1 deletion rstan/rstan/R/AllClass.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ setClass(Class = "cxxdso",
# 3. The binary dso with name dso_bin, which is a raw vector.
# We put it here since the environment is not copied
# when assigned to another
# http://cran.r-project.org/doc/manuals/R-lang.html#Environment-objects
# https://cran.r-project.org/doc/manuals/R-lang.html#Environment-objects
),
validity = function(object) {
length(object@sig) > 0 && identical(object@system, R.version$system)
Expand Down
86 changes: 54 additions & 32 deletions rstan/rstan/R/Rcpp_module_def.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,62 @@
get_Rcpp_module_def_code <- function(model_name) {
RCPP_MODULE <-
'
#include <rstan_next/stan_fit.hpp>
RCPP_MODULE(stan_fit4%model_name%_mod) {
class_<rstan::stan_fit<stan_model, boost::random::ecuyer1988> >(
"stan_fit4%model_name%")

struct stan_model_holder {
stan_model_holder(rstan::io::rlist_ref_var_context rcontext,
unsigned int random_seed)
: rcontext_(rcontext), random_seed_(random_seed)
{
}
.constructor<SEXP, SEXP, SEXP>()

//stan::math::ChainableStack ad_stack;
rstan::io::rlist_ref_var_context rcontext_;
unsigned int random_seed_;
};

Rcpp::XPtr<stan::model::model_base> model_ptr(stan_model_holder* smh) {
Rcpp::XPtr<stan::model::model_base> model_instance(new stan_model(smh->rcontext_, smh->random_seed_), true);
return model_instance;
}

Rcpp::XPtr<rstan::stan_fit_base> fit_ptr(stan_model_holder* smh) {
return Rcpp::XPtr<rstan::stan_fit_base>(new rstan::stan_fit(model_ptr(smh), smh->random_seed_), true);
}

std::string model_name(stan_model_holder* smh) {
return model_ptr(smh).get()->model_name();
}

RCPP_MODULE(stan_fit4%model_name%_mod){
Rcpp::class_<stan_model_holder>("stan_fit4%model_name%")
.constructor<rstan::io::rlist_ref_var_context, unsigned int>()
.method("model_ptr", &model_ptr)
.method("fit_ptr", &fit_ptr)
.method("model_name", &model_name)
;
.method(
"call_sampler",
&rstan::stan_fit<stan_model, boost::random::ecuyer1988>::call_sampler)
.method(
"param_names",
&rstan::stan_fit<stan_model, boost::random::ecuyer1988>::param_names)
.method("param_names_oi",
&rstan::stan_fit<stan_model,
boost::random::ecuyer1988>::param_names_oi)
.method("param_fnames_oi",
&rstan::stan_fit<stan_model,
boost::random::ecuyer1988>::param_fnames_oi)
.method(
"param_dims",
&rstan::stan_fit<stan_model, boost::random::ecuyer1988>::param_dims)
.method("param_dims_oi",
&rstan::stan_fit<stan_model,
boost::random::ecuyer1988>::param_dims_oi)
.method("update_param_oi",
&rstan::stan_fit<stan_model,
boost::random::ecuyer1988>::update_param_oi)
.method("param_oi_tidx",
&rstan::stan_fit<stan_model,
boost::random::ecuyer1988>::param_oi_tidx)
.method("grad_log_prob",
&rstan::stan_fit<stan_model,
boost::random::ecuyer1988>::grad_log_prob)
.method("log_prob",
&rstan::stan_fit<stan_model, boost::random::ecuyer1988>::log_prob)
.method("unconstrain_pars",
&rstan::stan_fit<stan_model,
boost::random::ecuyer1988>::unconstrain_pars)
.method("constrain_pars",
&rstan::stan_fit<stan_model,
boost::random::ecuyer1988>::constrain_pars)
.method(
"num_pars_unconstrained",
&rstan::stan_fit<stan_model,
boost::random::ecuyer1988>::num_pars_unconstrained)
.method(
"unconstrained_param_names",
&rstan::stan_fit<
stan_model, boost::random::ecuyer1988>::unconstrained_param_names)
.method(
"constrained_param_names",
&rstan::stan_fit<stan_model,
boost::random::ecuyer1988>::constrained_param_names)
.method("standalone_gqs",
&rstan::stan_fit<stan_model,
boost::random::ecuyer1988>::standalone_gqs);
}
'
gsub("%model_name%", model_name, RCPP_MODULE)
Expand Down
Loading