-#TODO: read in binary file, always same structure
-getDataFromFile(indices, file, type)
+#' assignMedoids
+#'
+#' Find the closest medoid for each curve in input
+#'
+#' @param curves (Chunk) of series whose medoids indices must be found
+#' @param medoids Matrix of medoids (in columns)
+#'
+#' @return The vector of integer assignments
+#' @export
+assignMedoids <- function(curves, medoids)
+{
+ nb_series <- ncol(curves)
+ mi <- rep(NA,nb_series)
+ for (i in seq_len(nb_series))
+ mi[i] <- which.min( colSums( sweep(medoids, 1, curves[,i], '-')^2 ) )
+ mi
+}
+
+#' filterMA
+#'
+#' Filter [time-]series by replacing all values by the moving average of values
+#' centered around current one. Border values are averaged with available data.
+#'
+#' @param M_ A real matrix of size LxD
+#' @param w_ The (odd) number of values to average
+#'
+#' @return The filtered matrix (in columns), of same size as the input
+#' @export
+filterMA <- function(M_, w_)
+ .Call("filterMA", M_, w_, PACKAGE="epclust")
+
+#' cleanBin
+#'
+#' Remove binary files to re-generate them at next run of \code{claws()}.
+#' To be run in the folder where computations occurred (or no effect).
+#'
+#' @export
+cleanBin <- function()