aboutsummaryrefslogtreecommitdiff
path: root/R/mkinfit.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/mkinfit.R')
-rw-r--r--R/mkinfit.R14
1 files changed, 12 insertions, 2 deletions
diff --git a/R/mkinfit.R b/R/mkinfit.R
index 693778fd..6cca5616 100644
--- a/R/mkinfit.R
+++ b/R/mkinfit.R
@@ -500,6 +500,13 @@ mkinfit <- function(mkinmod, observed,
}
}
+ # Get native symbol before iterations info for speed
+ if (solution_type == "deSolve" & use_compiled[1] != FALSE) {
+ 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
err_mod <- match.arg(error_model)
error_model_algorithm = match.arg(error_model_algorithm)
@@ -610,7 +617,8 @@ mkinfit <- function(mkinmod, observed,
solution_type = solution_type,
use_compiled = use_compiled,
method.ode = method.ode,
- atol = atol, rtol = rtol, ...)
+ atol = atol, rtol = rtol,
+ call_lsoda = call_lsoda, ...)
observed_index <- cbind(as.character(observed$time), as.character(observed$name))
observed$predicted <- out[observed_index]
@@ -892,7 +900,9 @@ mkinfit <- function(mkinmod, observed,
fit$calls <- calls
fit$time <- fit_time
- # We also need the model and a model name for summary and plotting
+ # We also need the model and a model name for summary and plotting,
+ # 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