[Scipy-svn] r4303 - in branches/refactor_fft/scipy/fftpack: . src src/fftw

scipy-svn at scipy.org scipy-svn at scipy.org
Tue May 13 01:55:21 EDT 2008


Author: cdavid
Date: 2008-05-13 00:55:12 -0500 (Tue, 13 May 2008)
New Revision: 4303

Added:
   branches/refactor_fft/scipy/fftpack/src/fftw/api.h
Modified:
   branches/refactor_fft/scipy/fftpack/setup.py
   branches/refactor_fft/scipy/fftpack/src/fftpack.cxx
   branches/refactor_fft/scipy/fftpack/src/fftpack.h
   branches/refactor_fft/scipy/fftpack/src/fftw/drfft.cxx
   branches/refactor_fft/scipy/fftpack/src/fftw/zfft.cxx
   branches/refactor_fft/scipy/fftpack/src/fftw/zfftnd.cxx
Log:
fftw is now a separate lib.

Modified: branches/refactor_fft/scipy/fftpack/setup.py
===================================================================
--- branches/refactor_fft/scipy/fftpack/setup.py	2008-05-13 05:48:23 UTC (rev 4302)
+++ branches/refactor_fft/scipy/fftpack/setup.py	2008-05-13 05:55:12 UTC (rev 4303)
@@ -8,7 +8,7 @@
     from numpy.distutils.system_info import get_info
     config = Configuration('fftpack',parent_package, top_path)
 
-    backends = ['mkl', 'djbfft', 'fftw3', 'fftw2']
+    backends = ['mkl', 'djbfft', 'fftw3', 'fftw']
     info = dict([(k, False) for k in backends])
 
     djbfft_info = {}
@@ -19,7 +19,7 @@
         info['mkl'] = True
     else:
         # Take the first in the list
-        for b in ['fftw3', 'fftw2']:
+        for b in ['fftw3', 'fftw']:
             tmp = get_info(b)
             if tmp:
                 fft_opt_info = tmp
@@ -39,8 +39,10 @@
                               ['zfft.cxx', 'drfft.cxx']]
     backends_src['fftw3'] = [join('src/fftw3/', i) for i in 
                              ['zfft.cxx', 'drfft.cxx', 'zfftnd.cxx']]
+    backends_src['fftw'] = [join('src/fftw/', i) for i in 
+                             ['zfft.cxx', 'drfft.cxx', 'zfftnd.cxx']]
 
-    for b in ['djbfft', 'fftw3']:
+    for b in ['djbfft', 'fftw3', 'fftw']:
         if info[b]:
             config.add_library('%s_backend' % b, 
                     sources = backends_src[b], 

Modified: branches/refactor_fft/scipy/fftpack/src/fftpack.cxx
===================================================================
--- branches/refactor_fft/scipy/fftpack/src/fftpack.cxx	2008-05-13 05:48:23 UTC (rev 4302)
+++ branches/refactor_fft/scipy/fftpack/src/fftpack.cxx	2008-05-13 05:55:12 UTC (rev 4303)
@@ -43,19 +43,6 @@
 #include "fftpack/zfftnd.cxx"
 #include "fftpack/zfft.cxx"
 
-#if defined(WITH_FFTW) || defined(WITH_MKL)
-static int equal_dims(int rank,int *dims1,int *dims2)
-{
-        int i;
-        for (i = 0; i < rank; ++i) {
-                if (dims1[i] != dims2[i]) {
-                        return 0;
-                }
-        }
-        return 1;
-}
-#endif
-
 #ifdef WITH_FFTW3
     #include "fftw3/drfft.cxx"
     #include "fftw3/zfft.cxx"

Modified: branches/refactor_fft/scipy/fftpack/src/fftpack.h
===================================================================
--- branches/refactor_fft/scipy/fftpack/src/fftpack.h	2008-05-13 05:48:23 UTC (rev 4302)
+++ branches/refactor_fft/scipy/fftpack/src/fftpack.h	2008-05-13 05:55:12 UTC (rev 4303)
@@ -57,8 +57,6 @@
 
 #ifdef SCIPY_FFTW_H
 #define WITH_FFTW
-#include <fftw.h>
-#include <rfftw.h>
 #endif
 
 #if defined(NO_APPEND_FORTRAN)

Added: branches/refactor_fft/scipy/fftpack/src/fftw/api.h
===================================================================
--- branches/refactor_fft/scipy/fftpack/src/fftw/api.h	2008-05-13 05:48:23 UTC (rev 4302)
+++ branches/refactor_fft/scipy/fftpack/src/fftw/api.h	2008-05-13 05:55:12 UTC (rev 4303)
@@ -0,0 +1,16 @@
+#ifndef _SCIPY_FFTPACK_FFTW_API_H_
+#define _SCIPY_FFTPACK_FFTW_API_H_
+
+#include "fftpack.h"
+
+void drfft_fftw(double * inout, int n, int direction, int howmany, 
+                  int normalize);
+
+void zfft_fftw(complex_double * inout,
+		 int n, int direction, int howmany, int normalize);
+
+void zfftnd_fftw(complex_double * inout, int rank,
+			 int *dims, int direction, int howmany,
+			 int normalize);
+
+#endif

Modified: branches/refactor_fft/scipy/fftpack/src/fftw/drfft.cxx
===================================================================
--- branches/refactor_fft/scipy/fftpack/src/fftw/drfft.cxx	2008-05-13 05:48:23 UTC (rev 4302)
+++ branches/refactor_fft/scipy/fftpack/src/fftw/drfft.cxx	2008-05-13 05:55:12 UTC (rev 4303)
@@ -1,5 +1,5 @@
 /*
- * Last Change: Sun May 11 09:00 PM 2008 J
+ * Last Change: Tue May 13 02:00 PM 2008 J
  *
  * FFTW2 implementation
  *
@@ -7,7 +7,11 @@
  */
 #include <new>
 
+#include <rfftw.h>
+#include <fftw.h>
+
 #include "cycliccache.h"
+#include "api.h"
 
 using namespace fft;
 
@@ -101,7 +105,7 @@
 
 CacheManager<RFFTWCacheId, RFFTWCache> rfftw_cmgr(10);
 
-static void drfft_fftw(double *inout, int n, int dir, 
+void drfft_fftw(double *inout, int n, int dir, 
                        int howmany, int normalize)
 {
         int i;

Modified: branches/refactor_fft/scipy/fftpack/src/fftw/zfft.cxx
===================================================================
--- branches/refactor_fft/scipy/fftpack/src/fftw/zfft.cxx	2008-05-13 05:48:23 UTC (rev 4302)
+++ branches/refactor_fft/scipy/fftpack/src/fftw/zfft.cxx	2008-05-13 05:55:12 UTC (rev 4303)
@@ -1,6 +1,10 @@
 #include <new>
 
+#include <rfftw.h>
+#include <fftw.h>
+
 #include "cycliccache.h"
+#include "api.h"
 
 using namespace fft;
 
@@ -64,7 +68,7 @@
 
 CacheManager<FFTWCacheId, FFTWCache> fftw_cmgr(10);
 
-extern void zfft_fftw(complex_double * inout, int n,
+void zfft_fftw(complex_double * inout, int n,
 		      int dir, int howmany, int normalize)
 {
 	int i;

Modified: branches/refactor_fft/scipy/fftpack/src/fftw/zfftnd.cxx
===================================================================
--- branches/refactor_fft/scipy/fftpack/src/fftw/zfftnd.cxx	2008-05-13 05:48:23 UTC (rev 4302)
+++ branches/refactor_fft/scipy/fftpack/src/fftw/zfftnd.cxx	2008-05-13 05:55:12 UTC (rev 4303)
@@ -3,15 +3,30 @@
  *
  * Original code by Pearu Peaterson
  *
- * Last Change: Sun May 11 09:00 PM 2008 J
+ * Last Change: Tue May 13 02:00 PM 2008 J
  */
 #include <new>
 #include <cassert>
 
+#include <fftw.h>
+#include <rfftw.h>
+
 #include <cycliccache.h>
+#include "api.h"
 
 using namespace fft;
 
+static int equal_dims(int rank,int *dims1,int *dims2)
+{
+        int i;
+        for (i = 0; i < rank; ++i) {
+                if (dims1[i] != dims2[i]) {
+                        return 0;
+                }
+        }
+        return 1;
+}
+
 class NDFFTWCacheId {
         public:
                 NDFFTWCacheId(int rank, int *dims, int dir, int flags);
@@ -146,7 +161,7 @@
 
 static CacheManager < NDFFTWCacheId, NDFFTWCache > fftwnd_cmgr(10);
 
-extern void zfftnd_fftw(complex_double * inout, int rank,
+void zfftnd_fftw(complex_double * inout, int rank,
 		       int *dims, int direction, int howmany,
 		       int normalize)
 {




More information about the Scipy-svn mailing list