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

scipy-svn@scip... scipy-svn@scip...
Mon May 12 22:27:50 CDT 2008


Author: cdavid
Date: 2008-05-12 22:27:43 -0500 (Mon, 12 May 2008)
New Revision: 4296

Added:
   branches/refactor_fft/scipy/fftpack/src/fftpack.cxx
Removed:
   branches/refactor_fft/scipy/fftpack/src/drfft.cxx
   branches/refactor_fft/scipy/fftpack/src/zfft.cxx
   branches/refactor_fft/scipy/fftpack/src/zfftnd.cxx
Modified:
   branches/refactor_fft/scipy/fftpack/SConstruct
   branches/refactor_fft/scipy/fftpack/setup.py
Log:
Start working on getting all types of fft defined at one location.

Modified: branches/refactor_fft/scipy/fftpack/SConstruct
===================================================================
--- branches/refactor_fft/scipy/fftpack/SConstruct	2008-05-13 01:57:19 UTC (rev 4295)
+++ branches/refactor_fft/scipy/fftpack/SConstruct	2008-05-13 03:27:43 UTC (rev 4296)
@@ -1,4 +1,4 @@
-# Last Change: Wed May 07 06:00 PM 2008 J
+# Last Change: Tue May 13 10:00 AM 2008 J
 # vim:syntax=python
 from os.path import join as pjoin
 
@@ -48,5 +48,5 @@
 env.NumpyPythonExtension('_fftpack', src)
 
 # Build convolve
-src = ['src/convolve.c',  'convolve.pyf']
+src = ['src/convolve.cxx',  'convolve.pyf']
 env.NumpyPythonExtension('convolve', src)

Modified: branches/refactor_fft/scipy/fftpack/setup.py
===================================================================
--- branches/refactor_fft/scipy/fftpack/setup.py	2008-05-13 01:57:19 UTC (rev 4295)
+++ branches/refactor_fft/scipy/fftpack/setup.py	2008-05-13 03:27:43 UTC (rev 4296)
@@ -24,8 +24,7 @@
     config.add_library('dfftpack',
                        sources=[join('dfftpack','*.f')])
 
-    sources = ['fftpack.pyf','src/zfft.cxx','src/drfft.cxx','src/zrfft.c',
-               'src/zfftnd.cxx']
+    sources = ['fftpack.pyf', 'src/fftpack.cxx', 'src/zrfft.c']
 
     config.add_extension('_fftpack',
         sources=sources,

Deleted: branches/refactor_fft/scipy/fftpack/src/drfft.cxx
===================================================================
--- branches/refactor_fft/scipy/fftpack/src/drfft.cxx	2008-05-13 01:57:19 UTC (rev 4295)
+++ branches/refactor_fft/scipy/fftpack/src/drfft.cxx	2008-05-13 03:27:43 UTC (rev 4296)
@@ -1,61 +0,0 @@
-/*
-  Interface to various FFT libraries.
-  Double real FFT and IFFT.
-  Author: Pearu Peterson, August 2002
- */
-
-#include "fftpack.h"
-
-/* The following macro convert private backend specific function to the public
- * functions exported by the module  */
-#define GEN_PUBLIC_API(name) \
-extern "C" void drfft(double *inout, int n, \
-        int direction, int howmany, int normalize)\
-{\
-        drfft_##name(inout, n, direction, howmany, normalize);\
-}
-
-/* ************** Definition of backend specific functions ********* */
-
-/*
- * To add a backend :
- *  - create a file drfft_name.c, where you define a function drfft_name where
- *  name is the name of your backend. If you do not use the GEN_CACHE macro,
- *  you will need to define a function void destroy_drname_caches(void), 
- *  which can do nothing
- *  - in drfft.c, include the drfft_name.c file, and add the 3 following lines
- *  just after it:
- *  #ifndef WITH_DJBFFT
- *      GEN_PUBLIC_API(name)
- *  #endif
- */
-
-#ifdef WITH_FFTW3
-    #include "fftw3/drfft.cxx"
-    #ifndef WITH_DJBFFT
-        GEN_PUBLIC_API(fftw3)
-    #endif
-#elif defined WITH_FFTW
-    #include "fftw/drfft.cxx"
-    #ifndef WITH_DJBFFT
-        GEN_PUBLIC_API(fftw)
-    #endif
-#else /* Use fftpack by default */
-    #include "fftpack/drfft.cxx"
-    #ifndef WITH_DJBFFT
-        GEN_PUBLIC_API(fftpack)
-    #endif 
-#endif
-
-/* 
- * djbfft must be used at the end, because it needs another backend (defined
- * above) for non 2^n * size 
- */
-#ifdef WITH_DJBFFT
-    #include "djbfft/drfft.cxx"
-    extern "C" void drfft(double *inout, int n, 
-            int direction, int howmany, int normalize)
-    {
-        drfft_djbfft(inout, n, direction, howmany, normalize);
-    }
-#endif

Added: branches/refactor_fft/scipy/fftpack/src/fftpack.cxx
===================================================================
--- branches/refactor_fft/scipy/fftpack/src/fftpack.cxx	2008-05-13 01:57:19 UTC (rev 4295)
+++ branches/refactor_fft/scipy/fftpack/src/fftpack.cxx	2008-05-13 03:27:43 UTC (rev 4296)
@@ -0,0 +1,90 @@
+#include "fftpack.h"
+
+/* The following macro convert private backend specific function to the public
+ * functions exported by the module  */
+#define GEN_ZFFT_API(name) \
+extern "C" void zfft(complex_double *inout, int n, \
+        int direction, int howmany, int normalize)\
+{\
+        zfft_##name(inout, n, direction, howmany, normalize);\
+}
+
+#define GEN_DRFFT_API(name) \
+extern "C" void drfft(double *inout, int n, \
+        int direction, int howmany, int normalize)\
+{\
+        drfft_##name(inout, n, direction, howmany, normalize);\
+}
+
+#define GEN_ZFFTND_API(name) \
+extern "C" void zfftnd(complex_double * inout, int rank,\
+		           int *dims, int direction, int howmany, int normalize)\
+{\
+        zfftnd_##name(inout, rank, dims, direction, howmany, normalize);\
+}
+
+
+/* ************** Definition of backend specific functions ********* */
+
+/*
+ * To add a backend :
+ *  - create a file drfft_name.c, where you define a function drfft_name where
+ *  name is the name of your backend. If you do not use the GEN_CACHE macro,
+ *  you will need to define a function void destroy_drname_caches(void), 
+ *  which can do nothing
+ *  - in drfft.c, include the drfft_name.c file, and add the 3 following lines
+ *  just after it:
+ *  #ifndef WITH_DJBFFT
+ *      GEN_PUBLIC_API(name)
+ *  #endif
+ */
+
+#include "fftpack/drfft.cxx"
+#include "fftpack/zfftnd.cxx"
+#include "fftpack/zfft.cxx"
+
+#ifdef WITH_FFTW3
+    #include "fftw3/drfft.cxx"
+    #include "fftw3/zfft.cxx"
+    #include "fftw3/zfftnd.cxx"
+    #ifndef WITH_DJBFFT
+        GEN_ZFFT_API(fftw3)
+        GEN_DRFFT_API(fftw3)
+        GEN_ZFFTND_API(fftw3)
+    #endif
+#elif defined WITH_FFTW
+    #include "fftw/drfft.cxx"
+    #include "fftw/zfft.cxx"
+    #include "fftw/zfftnd.cxx"
+    #ifndef WITH_DJBFFT
+        GEN_ZFFT_API(fftw)
+        GEN_DRFFT_API(fftw)
+        GEN_ZFFTND_API(fftw)
+    #endif
+#elif defined WITH_MKL
+    #include "mkl/zfft.cxx"
+    #include "mkl/zfftnd.cxx"
+    #ifndef WITH_DJBFFT
+        GEN_ZFFT_API(mkl)
+        GEN_ZFFTND_API(mkl)
+    #endif
+    GEN_DRFFT_API(fftpack)
+#endif
+
+#if (!defined WITH_DJBFFT) && (!defined WITH_MKL) \
+        && (!defined WITH_FFTW) && (!defined WITH_FFTW3)
+GEN_ZFFT_API(fftpack)
+GEN_DRFFT_API(fftpack)
+GEN_ZFFTND_API(fftpack)
+#endif 
+
+/* 
+ * djbfft must be used at the end, because it needs another backend (defined
+ * above) for non 2^n * size 
+ */
+#ifdef WITH_DJBFFT
+    #include "djbfft/drfft.cxx"
+    #include "djbfft/zfft.cxx"
+    GEN_DRFFT_API(djbfft)
+    GEN_ZFFT_API(djbfft)
+#endif

Deleted: branches/refactor_fft/scipy/fftpack/src/zfft.cxx
===================================================================
--- branches/refactor_fft/scipy/fftpack/src/zfft.cxx	2008-05-13 01:57:19 UTC (rev 4295)
+++ branches/refactor_fft/scipy/fftpack/src/zfft.cxx	2008-05-13 03:27:43 UTC (rev 4296)
@@ -1,53 +0,0 @@
-/*
-  Interface to various FFT libraries.
-  Double complex FFT and IFFT.
-  Author: Pearu Peterson, August 2002
- */
-
-#include "fftpack.h"
-
-/* The following macro convert private backend specific function to the public
- * functions exported by the module  */
-#define GEN_PUBLIC_API(name) \
-extern "C" void zfft(complex_double *inout, int n, \
-        int direction, int howmany, int normalize)\
-{\
-        zfft_##name(inout, n, direction, howmany, normalize);\
-}
-
-/* ************** Definition of backend specific functions ********* */
-
-#ifdef WITH_FFTW3
-    #include "fftw3/zfft.cxx"
-    #ifndef WITH_DJBFFT
-        GEN_PUBLIC_API(fftw3)
-    #endif
-#elif defined WITH_FFTW
-    #include "fftw/zfft.cxx"
-    #ifndef WITH_DJBFFT
-        GEN_PUBLIC_API(fftw)
-    #endif
-#elif defined WITH_MKL
-    #include "mkl/zfft.cxx"
-    #ifndef WITH_DJBFFT
-        GEN_PUBLIC_API(mkl)
-    #endif
-#else /* Use fftpack by default */
-    #include "fftpack/zfft.cxx"
-    #ifndef WITH_DJBFFT
-        GEN_PUBLIC_API(fftpack)
-    #endif 
-#endif
-
-/* 
- * djbfft must be used at the end, because it needs another backend (defined
- * above) for non 2^n * size 
- */
-#ifdef WITH_DJBFFT
-    #include "djbfft/zfft.cxx"
-    extern "C" void zfft(complex_double *inout, int n, 
-            int direction, int howmany, int normalize)
-    {
-        zfft_djbfft(inout, n, direction, howmany, normalize);
-    }
-#endif

Deleted: branches/refactor_fft/scipy/fftpack/src/zfftnd.cxx
===================================================================
--- branches/refactor_fft/scipy/fftpack/src/zfftnd.cxx	2008-05-13 01:57:19 UTC (rev 4295)
+++ branches/refactor_fft/scipy/fftpack/src/zfftnd.cxx	2008-05-13 03:27:43 UTC (rev 4296)
@@ -1,42 +0,0 @@
-/*
-  Interface to various FFT libraries.
-  Double complex FFT and IFFT, arbitrary dimensions.
-  Author: Pearu Peterson, August 2002
- */
-#include "fftpack.h"
-
-/* The following macro convert private backend specific function to the public
- * functions exported by the module  */
-#define GEN_PUBLIC_API(name) \
-extern "C" void zfftnd(complex_double * inout, int rank,\
-		           int *dims, int direction, int howmany, int normalize)\
-{\
-        zfftnd_##name(inout, rank, dims, direction, howmany, normalize);\
-}
-
-#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/zfftnd.cxx"
-        GEN_PUBLIC_API(fftw3)
-#elif defined WITH_FFTW
-        #include "fftw/zfftnd.cxx"
-        GEN_PUBLIC_API(fftw)
-#elif defined WITH_MKL
-        #include "mkl/zfftnd.cxx"
-        GEN_PUBLIC_API(mkl)
-#else /* Use fftpack by default */
-        #include "fftpack/zfftnd.cxx"
-        GEN_PUBLIC_API(fftpack)
-#endif



More information about the Scipy-svn mailing list