From ec9e65053b214fa30e8b947ccbc47930eeaa01a4 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 16 Apr 2015 11:00:53 +0200 Subject: Check compiled mkinmod versions in examples and tests Tests all pass (Linux) --- R/mkinfit.R | 3 +++ R/mkinpredict.R | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'R') 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) { -- cgit v1.2.1