Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper generation of param and init lists in TOUCH_FUNS #1013

Merged
merged 5 commits into from Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,7 +1,7 @@
Type: Package
Package: mrgsolve
Title: Simulate from ODE-Based Models
Version: 1.0.5
Version: 1.0.5.9000
Authors@R:
c(person(given = "Kyle T", family = "Baron",
role = c("aut", "cre"),
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
@@ -1,3 +1,10 @@
# mrgsolve (development version)

## Bugs Fixed

- Fix bug where parameter and compartment lists were not getting generated
properly when `mrgsolve` was not loaded (#1013).

# mrgsolve 1.0.5

- Changed behavior for dosing records where EVID = 4 and SS != 0
Expand Down
6 changes: 4 additions & 2 deletions src/devtran.cpp
Expand Up @@ -87,12 +87,14 @@ Rcpp::List DEVTRAN(const Rcpp::List parin,
request = request - 1;

// Parameters; clone names
const Rcpp::List Param = mod.slot("param");
const Rcpp::S4 ParamS4 = mod.slot("param");
const Rcpp::List Param = ParamS4.slot("data");
Rcpp::CharacterVector paramnames(Param.names());
paramnames = Rcpp::clone(paramnames);

// Compartments; clone names
const Rcpp::List Init = mod.slot("init");
const Rcpp::S4 InitS4 = mod.slot("init");
const Rcpp::List Init = InitS4.slot("data");
Rcpp::CharacterVector cmtnames(Init.names());
cmtnames = Rcpp::clone(cmtnames);
Rcpp::NumericVector init(Init.size());
Expand Down
6 changes: 4 additions & 2 deletions src/odeproblem.cpp
Expand Up @@ -716,8 +716,10 @@ Rcpp::List TOUCH_FUNS(const Rcpp::List& funs,
Rcpp::List ans;

Rcpp::Environment envir = mod.slot("envir");
Rcpp::List lparam = mod.slot("param");
Rcpp::List linit = mod.slot("init");
Rcpp::S4 paramS4 = mod.slot("param");
Rcpp::List lparam = paramS4.slot("data");
Rcpp::S4 initS4 = mod.slot("init");
Rcpp::List linit = initS4.slot("data");
Rcpp::CharacterVector capture = mod.slot("capture");

lparam = Rcpp::clone(lparam);
Expand Down