aboutsummaryrefslogtreecommitdiff
path: root/R/mkinfit.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2023-02-13 06:23:02 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2023-02-13 06:23:02 +0100
commit19861806ed790dc55380c64c6a5e27ba7ecd52de (patch)
treed33be92ab644e81e7ffc0c6a6e7e22af4c48005d /R/mkinfit.R
parent8d1a84ac2190538ed3bac53a303064e281595868 (diff)
WIP adapting to new deSolve with faster lsoda
Diffstat (limited to 'R/mkinfit.R')
-rw-r--r--R/mkinfit.R13
1 files changed, 5 insertions, 8 deletions
diff --git a/R/mkinfit.R b/R/mkinfit.R
index 0d9246dd..6cca5616 100644
--- a/R/mkinfit.R
+++ b/R/mkinfit.R
@@ -501,12 +501,10 @@ mkinfit <- function(mkinmod, observed,
}
# Get native symbol before iterations info for speed
- call_lsoda <- getNativeSymbolInfo("call_lsoda", PACKAGE = "deSolve")
if (solution_type == "deSolve" & use_compiled[1] != FALSE) {
- mkinmod$diffs_address <- getNativeSymbolInfo("diffs",
- PACKAGE = mkinmod$dll_info[["name"]])$address
- mkinmod$initpar_address <- getNativeSymbolInfo("initpar",
- PACKAGE = mkinmod$dll_info[["name"]])$address
+ mkinmod[["symbols"]] <- deSolve::checkDLL(dllname = mkinmod$dll_info[["name"]],
+ func = "diffs", initfunc = "initpar",
+ jacfunc = NULL, nout = 0, outnames = NULL)
}
# Get the error model and the algorithm for fitting
@@ -903,9 +901,8 @@ mkinfit <- function(mkinmod, observed,
fit$time <- fit_time
# We also need the model and a model name for summary and plotting,
- # but without address info that will become invalid
- mkinmod$diffs_address <- NULL
- mkinmod$initpar_address <- NULL
+ # but without symbols because they could become invalid
+ fit$symbols <- NULL
fit$mkinmod <- mkinmod
fit$mkinmod$name <- mkinmod_name
fit$obs_vars <- obs_vars

Contact - Imprint