[Scipy-svn] r4876 - branches/remove_fft_backends/scipy/fftpack/src

scipy-svn@scip... scipy-svn@scip...
Sat Nov 1 08:30:21 CDT 2008


Author: cdavid
Date: 2008-11-01 08:30:16 -0500 (Sat, 01 Nov 2008)
New Revision: 4876

Removed:
   branches/remove_fft_backends/scipy/fftpack/src/drfft_fftw3.c
   branches/remove_fft_backends/scipy/fftpack/src/zfft_fftw3.c
   branches/remove_fft_backends/scipy/fftpack/src/zfftnd_fftw3.c
Log:
Remove fftw3 wrappers.

Deleted: branches/remove_fft_backends/scipy/fftpack/src/drfft_fftw3.c
===================================================================
--- branches/remove_fft_backends/scipy/fftpack/src/drfft_fftw3.c	2008-11-01 13:30:05 UTC (rev 4875)
+++ branches/remove_fft_backends/scipy/fftpack/src/drfft_fftw3.c	2008-11-01 13:30:16 UTC (rev 4876)
@@ -1,65 +0,0 @@
-/*
- * Last Change: Wed Aug 01 07:00 PM 2007 J
- *
- * FFTW3 implementation
- *
- * Original code by Pearu Peterson.
- */
-
-GEN_CACHE(drfftw3, (int n, int d, int flags)
-	  , int direction;
-	  int flags;
-	  fftw_plan plan;
-	  double *ptr;, ((caches_drfftw3[i].n == n) &&
-			 (caches_drfftw3[i].direction == d) &&
-			 (caches_drfftw3[i].flags == flags))
-	  , caches_drfftw3[id].direction = d;
-	  caches_drfftw3[id].flags = flags;
-	  caches_drfftw3[id].ptr =
-	  (double *) fftw_malloc(sizeof(double) * (n));
-	  caches_drfftw3[id].plan =
-	  fftw_plan_r2r_1d(n, caches_drfftw3[id].ptr, caches_drfftw3[id].ptr,
-			   (d > 0 ? FFTW_R2HC : FFTW_HC2R), flags);,
-	  fftw_destroy_plan(caches_drfftw3[id].plan);
-	  fftw_free(caches_drfftw3[id].ptr);, 10)
-
-static void drfft_fftw3(double *inout, int n, int direction, int
-			howmany, int normalize)
-{
-    int i;
-    double *ptr = inout;
-
-    double *ptrc = NULL;
-    fftw_plan plan = NULL;
-
-    i = get_cache_id_drfftw3(n, direction, FFTW_ESTIMATE);
-    plan = caches_drfftw3[i].plan;
-    ptrc = caches_drfftw3[i].ptr;
-    switch (direction) {
-    case 1:
-        for (i = 0; i < howmany; ++i, ptr += n) {
-            memcpy(ptrc, ptr, sizeof(double) * n);
-            fftw_execute(plan);
-            COPYRFFTW2STD(ptrc, ptr, n);
-        }
-        break;
-
-    case -1:
-        for (i = 0; i < howmany; ++i, ptr += n) {
-            COPYINVRFFTW2STD(ptr, ptrc, n);
-            fftw_execute(plan);
-            memcpy(ptr, ptrc, sizeof(double) * n);
-        }
-        break;
-    default:
-        fprintf(stderr, "drfft: invalid direction=%d\n", direction);
-    }
-
-    if (normalize) {
-        double d = 1.0 / n;
-        ptr = inout;
-        for (i = n * howmany - 1; i >= 0; --i) {
-            (*(ptr++)) *= d;
-        }
-    }
-}

Deleted: branches/remove_fft_backends/scipy/fftpack/src/zfft_fftw3.c
===================================================================
--- branches/remove_fft_backends/scipy/fftpack/src/zfft_fftw3.c	2008-11-01 13:30:05 UTC (rev 4875)
+++ branches/remove_fft_backends/scipy/fftpack/src/zfft_fftw3.c	2008-11-01 13:30:16 UTC (rev 4876)
@@ -1,121 +0,0 @@
-
-/* This cache uses FFTW_MEASURE for the plans, and do not copy the data. */
-GEN_CACHE(zfftw3,(int n,int d)
-	,int direction;
-	fftw_plan plan;
-    fftw_complex *wrk;
-	,((caches_zfftw3[i].n==n) &&
-	    (caches_zfftw3[i].direction==d))
-	,caches_zfftw3[id].direction = d;
-        /* This working buffer is only used to compute the plan: we need it
-           since FFTW_MEASURE destroys its input when computing a plan */
-	    caches_zfftw3[id].wrk = fftw_malloc(n * sizeof(double) * 2); 
-	    caches_zfftw3[id].plan = fftw_plan_dft_1d(n, 
-	        caches_zfftw3[id].wrk,
-	        caches_zfftw3[id].wrk,
-		(d>0?FFTW_FORWARD:FFTW_BACKWARD),
-		FFTW_ESTIMATE | FFTW_UNALIGNED);
-	,
-    fftw_destroy_plan(caches_zfftw3[id].plan);
-	fftw_free(caches_zfftw3[id].wrk);
-	,10)
-
-static void zfft_fftw3(complex_double * inout, int n, int dir, int
-howmany, int normalize)
-{
-	fftw_complex    *ptr = (fftw_complex*)inout;
-    fftw_complex    *ptrm;
-	fftw_plan       plan = NULL;
-    double          factor = 1./n;
-
-	int i;
-
-	plan = caches_zfftw3[get_cache_id_zfftw3(n, dir)].plan;
-
-	switch (dir) {
-	case 1:
-		for (i = 0; i < howmany; ++i, ptr += n) {
-			fftw_execute_dft(plan, ptr, ptr);
-		}
-		break;
-
-	case -1:
-		for (i = 0; i < howmany; ++i, ptr += n) {
-			fftw_execute_dft(plan, ptr, ptr);
-		}
-		break;
-
-	default:
-		fprintf(stderr, "zfft: invalid dir=%d\n", dir);
-	}
-
-	if (normalize) {
-        ptr =(fftw_complex*)inout;
-		for (i = n * howmany - 1; i >= 0; --i) {
-			*((double *) (ptr)) *= factor;
-			*((double *) (ptr++) + 1) *= factor;
-		}
-	}
-}
-#if 0
-GEN_CACHE(zfftw3,(int n,int d)
-	,int direction;
-	fftw_plan plan;
-	fftw_complex* ptr;
-	,((caches_zfftw3[i].n==n) &&
-	    (caches_zfftw3[i].direction==d))
-	,caches_zfftw3[id].direction = d;
-	caches_zfftw3[id].ptr = fftw_malloc(sizeof(fftw_complex)*(n));
-	    caches_zfftw3[id].plan = fftw_plan_dft_1d(n, caches_zfftw3[id].ptr,
-	caches_zfftw3[id].ptr,
-		(d>0?FFTW_FORWARD:FFTW_BACKWARD),
-		FFTW_ESTIMATE);
-	,fftw_destroy_plan(caches_zfftw3[id].plan);
-	fftw_free(caches_zfftw3[id].ptr);
-	,10)
-
-static void zfft_fftw3(complex_double * inout, int n, int dir, int
-howmany, int normalize)
-{
-	complex_double *ptr = inout;
-	fftw_complex *ptrm = NULL;
-	fftw_plan plan = NULL;
-
-	int i;
-
-	plan = caches_zfftw3[get_cache_id_zfftw3(n, dir)].plan;
-
-	switch (dir) {
-	case 1:
-		for (i = 0; i < howmany; ++i, ptr += n) {
-			ptrm =
-			    caches_zfftw3[get_cache_id_zfftw3(n, dir)].ptr;
-			memcpy(ptrm, ptr, sizeof(double) * 2 * n);
-			fftw_execute(plan);
-			memcpy(ptr, ptrm, sizeof(double) * 2 * n);
-		}
-		break;
-
-	case -1:
-		for (i = 0; i < howmany; ++i, ptr += n) {
-			ptrm =
-			    caches_zfftw3[get_cache_id_zfftw3(n, dir)].ptr;
-			memcpy(ptrm, ptr, sizeof(double) * 2 * n);
-			fftw_execute(plan);
-			memcpy(ptr, ptrm, sizeof(double) * 2 * n);
-		}
-		break;
-
-	default:
-		fprintf(stderr, "zfft: invalid dir=%d\n", dir);
-	}
-
-	if (normalize) {
-		ptr = inout;
-		for (i = n * howmany - 1; i >= 0; --i) {
-			*((double *) (ptr)) /= n;
-			*((double *) (ptr++) + 1) /= n;
-		}
-	}
-}
-#endif

Deleted: branches/remove_fft_backends/scipy/fftpack/src/zfftnd_fftw3.c
===================================================================
--- branches/remove_fft_backends/scipy/fftpack/src/zfftnd_fftw3.c	2008-11-01 13:30:05 UTC (rev 4875)
+++ branches/remove_fft_backends/scipy/fftpack/src/zfftnd_fftw3.c	2008-11-01 13:30:16 UTC (rev 4876)
@@ -1,40 +0,0 @@
-/*
- * fftw3 backend for multi dimensional fft
- *
- * Original code by Pearu Peaterson
- *
- * Last Change: Wed Aug 08 02:00 PM 2007 J
- */
-
-/* stub because fftw3 has no cache mechanism (yet) */
-static void destroy_zfftnd_fftw3_caches(void) {}
-
-extern void zfftnd_fftw3(complex_double * inout, int rank,
-			   int *dims, int direction, int howmany,
-			   int normalize)
-{
-    int i, sz;
-    complex_double *ptr = inout;
-
-    fftw_plan plan = NULL;
-    sz = 1;
-    for (i = 0; i < rank; ++i) {
-        sz *= dims[i];
-    }
-    plan = fftw_plan_many_dft(rank, dims, howmany,
-			      (fftw_complex *) ptr, NULL, 1, sz,
-			      (fftw_complex *) ptr, NULL, 1, sz,
-			      (direction >
-			       0 ? FFTW_FORWARD : FFTW_BACKWARD),
-			      FFTW_ESTIMATE);
-    fftw_execute(plan);
-    fftw_destroy_plan(plan);
-
-    if (normalize) {
-        ptr = inout;
-        for (i = sz * howmany - 1; i >= 0; --i) {
-            *((double *) (ptr)) /= sz;
-            *((double *) (ptr++) + 1) /= sz;
-        }
-    }
-}



More information about the Scipy-svn mailing list