diff --git a/NAMESPACE b/NAMESPACE index d0f0416..175d9de 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -116,7 +116,4 @@ importFrom(stats,window) importFrom(stats,xtabs) importFrom(xtable,print.xtable) importFrom(xtable,xtable) -useDynLib(dtwSat,bestmatches) -useDynLib(dtwSat,computecost) -useDynLib(dtwSat,g) -useDynLib(dtwSat,tracepath) +useDynLib(dtwSat, .registration = TRUE) diff --git a/R/dtw.R b/R/dtw.R index a25b679..ced07cd 100644 --- a/R/dtw.R +++ b/R/dtw.R @@ -13,7 +13,7 @@ ############################################################### -#' @useDynLib dtwSat computecost +# @useDynLib dtwSat computecost .computecost = function(cm, step.matrix){ cm = rbind(0, cm) @@ -21,15 +21,14 @@ m = ncol(cm) if(is.loaded("computecost", PACKAGE = "dtwSat", type = "Fortran")){ - out = .Fortran("computecost", + out = .Fortran(computecost, CM = matrix(as.double(cm), n, m), DM = matrix(as.integer(0), n, m), VM = matrix(as.integer(0), n, m), SM = matrix(as.integer(step.matrix), nrow(step.matrix), ncol(step.matrix)), N = as.integer(n), M = as.integer(m), - NS = as.integer(nrow(step.matrix)), - PACKAGE="dtwSat") + NS = as.integer(nrow(step.matrix))) } else { stop("Fortran computecost lib is not loaded") } @@ -45,7 +44,7 @@ } -#' @useDynLib dtwSat tracepath +# @useDynLib dtwSat tracepath .tracepath = function(dm, step.matrix, jmin){ n = nrow(dm) @@ -55,7 +54,7 @@ if(is.loaded("tracepath", PACKAGE = "dtwSat", type = "Fortran")){ aloc = length(jmin)*10*n - paths = .Fortran("tracepath", + paths = .Fortran(tracepath, DM = matrix(as.integer(dm), n, m), SM = matrix(as.integer(step.matrix), nrow(step.matrix), ncol(step.matrix)), JMIN = as.vector(as.integer(jmin)), @@ -66,8 +65,7 @@ M = as.integer(m), NS = as.integer(nrow(step.matrix)), NJ = as.integer(length(jmin)), - AL = as.integer(aloc), - PACKAGE="dtwSat") + AL = as.integer(aloc)) res = lapply(seq_along(paths$POS)[-1], function(p){ I = paths$POS[p]:((paths$POS[p-1])+1) @@ -80,7 +78,7 @@ res } -#' @useDynLib dtwSat bestmatches +# @useDynLib dtwSat bestmatches .bestmatches = function(x, m, n, levels, breaks, overlap, fill=9999){ if(is.loaded("bestmatches", PACKAGE = "dtwSat", type = "Fortran")){ if(length(x[[1]]$distance)<1){ @@ -97,7 +95,7 @@ L = as.integer(length(levels)), OV = as.double(overlap)) } else { - res = try(.Fortran("bestmatches", + res = try(.Fortran(bestmatches, XM = matrix(as.integer(c(as.numeric(x[[1]]$from), as.numeric(x[[1]]$to))), ncol = 2), AM = matrix(as.double(fill), nrow = n, ncol = m), DM = as.double(x[[1]]$distance), @@ -108,8 +106,7 @@ K = as.integer(length(x)), P = as.integer(length(breaks)), L = as.integer(length(levels)), - OV = as.double(overlap), - PACKAGE="dtwSat")) + OV = as.double(overlap))) } } else { stop("Fortran bestmatches lib is not loaded") diff --git a/R/twdtw.R b/R/twdtw.R index 154a0cb..00a7300 100644 --- a/R/twdtw.R +++ b/R/twdtw.R @@ -144,7 +144,7 @@ initAlignments = function(...){ res } -#' @useDynLib dtwSat g +# @useDynLib dtwSat g .g = function(phi, step.matrix){ if(!is.loaded("g", PACKAGE = "dtwSat", type = "Fortran")) @@ -152,12 +152,11 @@ initAlignments = function(...){ n = nrow(phi) m = ncol(phi) - res = .Fortran("g", + res = .Fortran(g, TM = matrix(as.double(phi), n, m), N = as.integer(n), M = as.integer(m), - PC = as.double(366), - PACKAGE="dtwSat") + PC = as.double(366)) res$TM } diff --git a/R/zzz.R b/R/zzz.R index 26e7ed9..7c1b731 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -35,7 +35,7 @@ #' @importFrom lubridate month month<- day day<- year year<- #' @importFrom caret createDataPartition #' @importFrom xtable xtable print.xtable -# @useDynLib dtwSat, .registration = TRUE +#' @useDynLib dtwSat, .registration = TRUE #' NULL diff --git a/cran-comments.md b/cran-comments.md index 442724b..d225014 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -7,14 +7,6 @@ # v0.2.2 -* Fixed from previous version - -checking compiled code ... NOTE - File 'dtwSat/libs/i386/dtwSat.dll': - Found no call to: 'R_registerRoutines' - File 'dtwSat/libs/x64/dtwSat.dll': - Found no call to: 'R_registerRoutines' - # v0.2.1 * Fix Solaris installation errors.