use Rcpp; ongoing debug for parallel synchrones computation
[epclust.git] / epclust / src / filter.c
diff --git a/epclust/src/filter.c b/epclust/src/filter.c
deleted file mode 100644 (file)
index 382910a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <stdlib.h>
-#include <R.h>
-#include <Rinternals.h>
-#include <Rmath.h>
-
-#include <stdio.h>
-
-SEXP filter(SEXP cwt_)
-{
-       int L = INTEGER(getAttrib(cwt_, R_DimSymbol))[0],
-               D = INTEGER(getAttrib(cwt_, R_DimSymbol))[1];
-       double *cwt = REAL(cwt_);
-       SEXP R_fcwt;
-       PROTECT(R_fcwt = allocMatrix(REALSXP, L, D));
-       double* fcwt = REAL(R_fcwt);
-
-       //TODO: coding style is terrible... no time for now.
-       for (int col=0; col<D; col++)
-       {
-               double v1 = cwt[0];
-               double ma = v1 + cwt[1] + cwt[2];
-               for (int i=1; i<L-2; i++)
-               {
-                       fcwt[i] = ma / 3.;
-                       ma = ma - v1 + cwt[i+2];
-                       v1 = cwt[i];
-               }
-               fcwt[0] = cwt[0];
-               fcwt[L-2] = ma / 3.;
-               fcwt[L-1] = cwt[L-1];
-               cwt = cwt + L;
-               fcwt = fcwt + L;
-       }
-
-       UNPROTECT(1);
-       return R_fcwt;
-}