aboutsummaryrefslogtreecommitdiff
path: root/R/mkinmod.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2015-05-15 14:04:49 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2015-05-15 14:04:49 +0200
commitffc12f79fdb283bc59f073208c883b84271be121 (patch)
treea22b49971aa1a466421412aa8bbce9aa117afe53 /R/mkinmod.R
parent6c65cba39dbca98caf3f8e69552b3454ec1721fc (diff)
Make mkinmod quiet in tests
Diffstat (limited to 'R/mkinmod.R')
-rw-r--r--R/mkinmod.R8
1 files changed, 4 insertions, 4 deletions
diff --git a/R/mkinmod.R b/R/mkinmod.R
index 149d2beb..e865fa27 100644
--- a/R/mkinmod.R
+++ b/R/mkinmod.R
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/> }}}
-mkinmod <- function(..., use_of_ff = "min", speclist = NULL)
+mkinmod <- function(..., use_of_ff = "min", speclist = NULL, quiet = FALSE)
{
if (is.null(speclist)) spec <- list(...)
else spec <- speclist
@@ -272,8 +272,8 @@ mkinmod <- function(..., use_of_ff = "min", speclist = NULL)
model$coefmat <- m
}#}}}
- # Create a function compiled from C code if possible #{{{
- if (requireNamespace("ccSolve", quietly = TRUE)) {
+ # Create a function compiled from C code if more than one observed variable and ccSolve is available #{{{
+ if (length(obs_vars) > 1 & requireNamespace("ccSolve", quietly = TRUE)) {
diffs.C <- paste(diffs, collapse = ";\n")
diffs.C <- paste0(diffs.C, ";")
for (i in seq_along(diffs)) {
@@ -297,7 +297,7 @@ mkinmod <- function(..., use_of_ff = "min", speclist = NULL)
}
if (sum(sapply(spec, function(x) x$type %in%
c("SFO", "FOMC", "DFOP", "SFORB"))) == length(spec)) {
- message("Compiling differential equation model from auto-generated C code...")
+ if (!quiet) message("Compiling differential equation model from auto-generated C code...")
model$compiled <- ccSolve::compile.ode(diffs.C, language = "C",
parms = parms,
declaration = "double time = *t;")

Contact - Imprint