[Scipy-svn] r6224 - trunk/scipy/fftpack

scipy-svn@scip... scipy-svn@scip...
Tue Feb 9 19:50:37 CST 2010


Author: cdavid
Date: 2010-02-09 19:50:37 -0600 (Tue, 09 Feb 2010)
New Revision: 6224

Modified:
   trunk/scipy/fftpack/basic.py
Log:
BUG: fix single precision handling for ifftn.

Modified: trunk/scipy/fftpack/basic.py
===================================================================
--- trunk/scipy/fftpack/basic.py	2010-02-10 01:50:25 UTC (rev 6223)
+++ trunk/scipy/fftpack/basic.py	2010-02-10 01:50:37 UTC (rev 6224)
@@ -263,7 +263,6 @@
         work_function = fftpack.drfft
     return _raw_fft(tmp,n,axis,-1,overwrite_x,work_function)
 
-
 def _raw_fftnd(x, s, axes, direction, overwrite_x, work_function):
     """ Internal auxiliary function for fftnd, ifftnd."""
     if s is None:
@@ -352,6 +351,9 @@
     Notes:
       y == fftn(ifftn(y)) within numerical accuracy.
     """
+    return _raw_fftn_dispatch(x, shape, axes, overwrite_x, 1)
+
+def _raw_fftn_dispatch(x, shape, axes, overwrite_x, direction):
     tmp = asarray(x)
     if istype(tmp, numpy.complex128):
         overwrite_x = overwrite_x or (tmp is not x and not \
@@ -365,7 +367,7 @@
             work_function = fftpack.cfftnd
         else:
             work_function = fftpack.zfftnd
-    return _raw_fftnd(tmp,shape,axes,1,overwrite_x,work_function)
+    return _raw_fftnd(tmp,shape,axes,direction,overwrite_x,work_function)
 
 
 def ifftn(x, shape=None, axes=None, overwrite_x=0):
@@ -383,19 +385,8 @@
 
     Optional input: see fftn.__doc__
     """
-    tmp = asarray(x)
-    if istype(tmp, numpy.complex128):
-        overwrite_x = overwrite_x or (tmp is not x and not \
-                                      hasattr(x,'__array__'))
-        work_function = fftpack.zfftnd
-    elif istype(tmp, numpy.complex64):
-        raise NotImplementedError
-    else:
-        overwrite_x = 1
-        work_function = fftpack.zfftnd
-    return _raw_fftnd(tmp,shape,axes,-1,overwrite_x,work_function)
+    return _raw_fftn_dispatch(x, shape, axes, overwrite_x, -1)
 
-
 def fft2(x, shape=None, axes=(-2,-1), overwrite_x=0):
     """
     2-D discrete Fourier transform.



More information about the Scipy-svn mailing list