[Scipy-svn] r2888 - trunk/Lib/ndimage/src

scipy-svn@scip... scipy-svn@scip...
Thu Mar 29 05:10:23 CDT 2007


Author: stefan
Date: 2007-03-29 05:10:07 -0500 (Thu, 29 Mar 2007)
New Revision: 2888

Modified:
   trunk/Lib/ndimage/src/nd_image.h
   trunk/Lib/ndimage/src/ni_fourier.c
Log:
Fix complex handling.


Modified: trunk/Lib/ndimage/src/nd_image.h
===================================================================
--- trunk/Lib/ndimage/src/nd_image.h	2007-03-29 09:51:45 UTC (rev 2887)
+++ trunk/Lib/ndimage/src/nd_image.h	2007-03-29 10:10:07 UTC (rev 2888)
@@ -56,8 +56,8 @@
      tUInt64=PyArray_UINT64,
      tFloat32=PyArray_FLOAT32,
      tFloat64=PyArray_FLOAT64,
-     tComplex32=PyArray_COMPLEX64,
-     tComplex64=PyArray_COMPLEX128,
+     tComplex64=PyArray_COMPLEX64,
+     tComplex128=PyArray_COMPLEX128,
      tObject=PyArray_OBJECT,        /* placeholder... does nothing */
      tMaxType=PyArray_NTYPES,
      tDefault = tFloat64,

Modified: trunk/Lib/ndimage/src/ni_fourier.c
===================================================================
--- trunk/Lib/ndimage/src/ni_fourier.c	2007-03-29 09:51:45 UTC (rev 2887)
+++ trunk/Lib/ndimage/src/ni_fourier.c	2007-03-29 10:10:07 UTC (rev 2888)
@@ -359,19 +359,19 @@
     default:
       break;
     }
-    if (input->descr->type_num == tComplex32 ||
-        input->descr->type_num == tComplex64) {
+    if (input->descr->type_num == tComplex64 ||
+        input->descr->type_num == tComplex128) {
       double tmp_r = 0.0, tmp_i = 0.0;
       switch (input->descr->type_num) {
-          /*CASE_FOURIER_FILTER_RC(pi, tmp, tmp_r, tmp_i, Complex32);*/
         CASE_FOURIER_FILTER_RC(pi, tmp, tmp_r, tmp_i, Complex64);
+        CASE_FOURIER_FILTER_RC(pi, tmp, tmp_r, tmp_i, Complex128);
       default:
         PyErr_SetString(PyExc_RuntimeError, "data type not supported");
         goto exit;
       }
       switch (output->descr->type_num) {
-          /*CASE_FOURIER_OUT_CC(po, tmp_r, tmp_i, Complex32);*/
         CASE_FOURIER_OUT_CC(po, tmp_r, tmp_i, Complex64);
+        CASE_FOURIER_OUT_CC(po, tmp_r, tmp_i, Complex128);
       default:
         PyErr_SetString(PyExc_RuntimeError, "data type not supported");
         goto exit;
@@ -398,8 +398,8 @@
       switch (output->descr->type_num) {
         CASE_FOURIER_OUT_RR(po, tmp, Float32);
         CASE_FOURIER_OUT_RR(po, tmp, Float64);
-        /*CASE_FOURIER_OUT_RC(po, tmp, Complex32);*/
         CASE_FOURIER_OUT_RC(po, tmp, Complex64);
+        CASE_FOURIER_OUT_RC(po, tmp, Complex128);
       default:
         PyErr_SetString(PyExc_RuntimeError, "data type not supported");
         goto exit;
@@ -521,15 +521,15 @@
       CASE_FOURIER_SHIFT_R(pi, tmp, r, i, cost, sint, Int64)
       CASE_FOURIER_SHIFT_R(pi, tmp, r, i, cost, sint, Float32)
       CASE_FOURIER_SHIFT_R(pi, tmp, r, i, cost, sint, Float64)
-          /*CASE_FOURIER_SHIFT_C(pi, r, i, cost, sint, Complex32)*/
       CASE_FOURIER_SHIFT_C(pi, r, i, cost, sint, Complex64)
+      CASE_FOURIER_SHIFT_C(pi, r, i, cost, sint, Complex128)
     default:
       PyErr_SetString(PyExc_RuntimeError, "data type not supported");
       goto exit;
     }
     switch (output->descr->type_num) {
-        /*CASE_FOURIER_OUT_CC(po, r, i, Complex32);*/
       CASE_FOURIER_OUT_CC(po, r, i, Complex64);
+      CASE_FOURIER_OUT_CC(po, r, i, Complex128);
     default:
       PyErr_SetString(PyExc_RuntimeError, "data type not supported");
       goto exit;



More information about the Scipy-svn mailing list