From 9a42d69ee1a3181eab55da21dddcb766622a3865 Mon Sep 17 00:00:00 2001 From: jranke Date: Wed, 16 May 2012 12:13:22 +0000 Subject: Fixed a bug in mkinmod that produced a erroneous coefficient matrix if more than one SFORB submodel is used git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/mkin@38 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- R/mkinmod.R | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'R') diff --git a/R/mkinmod.R b/R/mkinmod.R index 41dbefa..c7f11d9 100644 --- a/R/mkinmod.R +++ b/R/mkinmod.R @@ -193,8 +193,12 @@ mkinmod <- function(..., use_of_ff = "min") } else { # off-diagonal elements k.candidate = paste("k", from, to, sep="_") - k.candidate = sub("free.*bound", "free_bound", k.candidate) - k.candidate = sub("bound.*free", "bound_free", k.candidate) + if (sub("_free$", "", from) == sub("_bound$", "", to)) { + k.candidate = paste("k", sub("_free$", "_free_bound", from), sep="_") + } + if (sub("_bound$", "", from) == sub("_free$", "", to)) { + k.candidate = paste("k", sub("_bound$", "_bound_free", from), sep="_") + } k.effective = intersect(model$parms, k.candidate) m[to, from] = ifelse(length(k.effective) > 0, k.effective, "0") @@ -218,8 +222,7 @@ mkinmod <- function(..., use_of_ff = "min") } else { # off-diagonal elements f.candidate = paste("f", from, "to", to, sep="_") k.candidate = paste("k", from, to, sep="_") - k.candidate = sub("free.*bound", "free_bound", k.candidate) - k.candidate = sub("bound.*free", "bound_free", k.candidate) + # SFORB with maximum use of formation fractions not implemented, see above m[to, from] = ifelse(f.candidate %in% model$parms, paste(f.candidate, " * k_", from, sep=""), ifelse(k.candidate %in% model$parms, k.candidate, "0")) -- cgit v1.2.1