From 5a986f2064cf0b2fbd94e636cc4fa56d9939ca42 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 3 Nov 2020 05:08:25 +0100 Subject: C implementation of the SFO function Only pays off for large time series with length >> 100 --- R/parent_solutions.R | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'R') diff --git a/R/parent_solutions.R b/R/parent_solutions.R index 04226b73..bbdffc21 100644 --- a/R/parent_solutions.R +++ b/R/parent_solutions.R @@ -22,11 +22,9 @@ #' #' \dontrun{plot(function(x) SFO.solution(x, 100, 3), 0, 2)} #' +#' @useDynLib mkin SFO_solution #' @export -SFO.solution <- function(t, parent_0, k) -{ - parent = parent_0 * exp(-k * t) -} +SFO.solution <- function(t, parent_0, k) .Call(SFO_solution, as.double(t), as.double(parent_0), as.double(k)) #' First-Order Multi-Compartment kinetics #' -- cgit v1.2.3