aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2015-04-16 11:00:53 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2015-04-16 11:00:53 +0200
commitec9e65053b214fa30e8b947ccbc47930eeaa01a4 (patch)
tree2328b5015f55363e753f6ca346805ccd75fe0d63 /R
parent10fb9aac470d87afbe2d4ee9e3d1898bfc3f1aa7 (diff)
Check compiled mkinmod versions in examples and tests
Tests all pass (Linux)
Diffstat (limited to 'R')
-rw-r--r--R/mkinfit.R3
-rw-r--r--R/mkinpredict.R3
2 files changed, 5 insertions, 1 deletions
diff --git a/R/mkinfit.R b/R/mkinfit.R
index b0df6e8c..38f76674 100644
--- a/R/mkinfit.R
+++ b/R/mkinfit.R
@@ -28,6 +28,7 @@ mkinfit <- function(mkinmod, observed,
fixed_initials = names(mkinmod$diffs)[-1],
solution_type = "auto",
method.ode = "lsoda",
+ use_compiled = "auto",
method.modFit = c("Port", "Marq", "SANN", "Nelder-Mead", "BFGS", "CG", "L-BFGS-B"),
maxit.modFit = "auto",
control.modFit = list(),
@@ -263,6 +264,7 @@ mkinfit <- function(mkinmod, observed,
out <- mkinpredict(mkinmod, parms,
odeini, outtimes,
solution_type = solution_type,
+ use_compiled = use_compiled,
method.ode = method.ode,
atol = atol, rtol = rtol, ...)
@@ -282,6 +284,7 @@ mkinfit <- function(mkinmod, observed,
out_plot <- mkinpredict(mkinmod, parms,
odeini, outtimes_plot,
solution_type = solution_type,
+ use_compiled = use_compiled,
method.ode = method.ode,
atol = atol, rtol = rtol, ...)
diff --git a/R/mkinpredict.R b/R/mkinpredict.R
index bed82441..864eefbe 100644
--- a/R/mkinpredict.R
+++ b/R/mkinpredict.R
@@ -19,6 +19,7 @@
mkinpredict <- function(mkinmod, odeparms, odeini,
outtimes, solution_type = "deSolve",
+ use_compiled = "auto",
method.ode = "lsoda", atol = 1e-8, rtol = 1e-10,
map_output = TRUE, ...) {
@@ -87,7 +88,7 @@ mkinpredict <- function(mkinmod, odeparms, odeini,
names(out) <- c("time", mod_vars)
}
if (solution_type == "deSolve") {
- if (!is.null(mkinmod$compiled)) {
+ if (!is.null(mkinmod$compiled) & use_compiled[1] != FALSE) {
mkindiff <- mkinmod$compiled
} else {
mkindiff <- function(t, state, parms) {

Contact - Imprint