[Scipy-svn] r5476 - trunk/scipy/fftpack/src

scipy-svn@scip... scipy-svn@scip...
Sat Jan 17 05:10:21 CST 2009


Author: cdavid
Date: 2009-01-17 05:10:10 -0600 (Sat, 17 Jan 2009)
New Revision: 5476

Modified:
   trunk/scipy/fftpack/src/dct.c
Log:
Reindent.

Modified: trunk/scipy/fftpack/src/dct.c
===================================================================
--- trunk/scipy/fftpack/src/dct.c	2009-01-17 11:09:41 UTC (rev 5475)
+++ trunk/scipy/fftpack/src/dct.c	2009-01-17 11:10:10 UTC (rev 5476)
@@ -64,22 +64,22 @@
 
 	wsave = caches_dct1[get_cache_id_dct1(n)].wsave;
 
-        for (i = 0; i < howmany; ++i, ptr += n) {
-                dcost_(&n, (double*)(ptr), wsave);
-        }
+    for (i = 0; i < howmany; ++i, ptr += n) {
+        dcost_(&n, (double*)(ptr), wsave);
+    }
 
 	if (normalize) {
-                fprintf(stderr, "dct1: normalize not yet supported=%d\n",
-                                normalize);
-	} else {
-                ptr = inout;
-		/* 0.5 coeff comes from fftpack defining DCT as
-		 * 4 * sum(cos(something)), whereas most definition 
-		 * use 2 */
-                for (i = n * howmany - 1; i >= 0; --i, ++ptr) {
-                        *((double *) (ptr)) *= 0.5;
-                }
+        fprintf(stderr, "dct1: normalize not yet supported=%d\n",
+                normalize);
+    } else {
+        ptr = inout;
+        /* 0.5 coeff comes from fftpack defining DCT as
+         * 4 * sum(cos(something)), whereas most definition 
+         * use 2 */
+        for (i = n * howmany - 1; i >= 0; --i, ++ptr) {
+            *((double *) (ptr)) *= 0.5;
         }
+    }
 }
 
 void dct2(double * inout, int n, int howmany, int normalize)
@@ -91,39 +91,39 @@
 
 	wsave = caches_dct2[get_cache_id_dct2(n)].wsave;
 
-        for (i = 0; i < howmany; ++i, ptr += n) {
-                dcosqb_(&n, (double *) (ptr), wsave);
+    for (i = 0; i < howmany; ++i, ptr += n) {
+        dcosqb_(&n, (double *) (ptr), wsave);
 
-        }
+    }
 
-	switch (normalize) {
-	case DCT_NORMALIZE_NO:
-        ptr = inout;
-		/* 0.5 coeff comes from fftpack defining DCT as
-		 * 4 * sum(cos(something)), whereas most definition 
-		 * use 2 */
-        for (i = n * howmany - 1; i >= 0; --i, ++ptr) {
-            *((double *) (ptr)) *= 0.5;
-        }
-		break;
-	case DCT_NORMALIZE_ORTHONORMAL:
-        ptr = inout;
-		/* 0.5 coeff comes from fftpack defining DCT as
-		 * 4 * sum(cos(something)), whereas most definition 
-		 * use 2 */
-		n1 = 0.25 * sqrt(1./n);
-		n2 = 0.25 * sqrt(2./n);
-        for (i = 0; i < howmany; ++i, ptr+=n) {
-            ptr[0] *= n1;
-            for (j = 1; j < n; ++j) {
-                ptr[j] *= n2;
+    switch (normalize) {
+        case DCT_NORMALIZE_NO:
+            ptr = inout;
+            /* 0.5 coeff comes from fftpack defining DCT as
+             * 4 * sum(cos(something)), whereas most definition 
+             * use 2 */
+            for (i = n * howmany - 1; i >= 0; --i, ++ptr) {
+                *((double *) (ptr)) *= 0.5;
             }
-        } 
-		break;
-	default:
-        fprintf(stderr, "dct2: normalize not yet supported=%d\n",
-                        normalize);
-		break;
+            break;
+        case DCT_NORMALIZE_ORTHONORMAL:
+            ptr = inout;
+            /* 0.5 coeff comes from fftpack defining DCT as
+             * 4 * sum(cos(something)), whereas most definition 
+             * use 2 */
+            n1 = 0.25 * sqrt(1./n);
+            n2 = 0.25 * sqrt(2./n);
+            for (i = 0; i < howmany; ++i, ptr+=n) {
+                ptr[0] *= n1;
+                for (j = 1; j < n; ++j) {
+                    ptr[j] *= n2;
+                }
+            } 
+            break;
+        default:
+            fprintf(stderr, "dct2: normalize not yet supported=%d\n",
+                    normalize);
+            break;
     }
 }
 
@@ -135,22 +135,22 @@
 
 	wsave = caches_fdct1[get_cache_id_fdct1(n)].wsave;
 
-        for (i = 0; i < howmany; ++i, ptr += n) {
-                cost_(&n, (float*)(ptr), wsave);
-        }
+    for (i = 0; i < howmany; ++i, ptr += n) {
+        cost_(&n, (float*)(ptr), wsave);
+    }
 
-	if (normalize) {
-                fprintf(stderr, "dct1: normalize not yet supported=%d\n",
-                                normalize);
-	} else {
-                ptr = inout;
-		/* 0.5 coeff comes from fftpack defining DCT as
-		 * 4 * sum(cos(something)), whereas most definition 
-		 * use 2 */
-                for (i = n * howmany - 1; i >= 0; --i, ++ptr) {
-                        *((float *) (ptr)) *= 0.5;
-                }
+    if (normalize) {
+        fprintf(stderr, "dct1: normalize not yet supported=%d\n",
+                normalize);
+    } else {
+        ptr = inout;
+        /* 0.5 coeff comes from fftpack defining DCT as
+         * 4 * sum(cos(something)), whereas most definition 
+         * use 2 */
+        for (i = n * howmany - 1; i >= 0; --i, ++ptr) {
+            *((float *) (ptr)) *= 0.5;
         }
+    }
 }
 
 void fdct2(float * inout, int n, int howmany, int normalize)
@@ -162,38 +162,38 @@
 
 	wsave = caches_fdct2[get_cache_id_fdct2(n)].wsave;
 
-        for (i = 0; i < howmany; ++i, ptr += n) {
-                cosqb_(&n, (float *) (ptr), wsave);
+    for (i = 0; i < howmany; ++i, ptr += n) {
+        cosqb_(&n, (float *) (ptr), wsave);
 
-        }
+    }
 
-	switch (normalize) {
-	case DCT_NORMALIZE_NO:
-        ptr = inout;
-		/* 0.5 coeff comes from fftpack defining DCT as
-		 * 4 * sum(cos(something)), whereas most definition 
-		 * use 2 */
-        for (i = n * howmany - 1; i >= 0; --i, ++ptr) {
-            *((float *) (ptr)) *= 0.5;
-        }
-		break;
-	case DCT_NORMALIZE_ORTHONORMAL:
-        ptr = inout;
-		/* 0.5 coeff comes from fftpack defining DCT as
-		 * 4 * sum(cos(something)), whereas most definition 
-		 * use 2 */
-		n1 = 0.25 * sqrt(1./n);
-		n2 = 0.25 * sqrt(2./n);
-        for (i = 0; i < howmany; ++i, ptr+=n) {
-            ptr[0] *= n1;
-            for (j = 1; j < n; ++j) {
-                ptr[j] *= n2;
+    switch (normalize) {
+        case DCT_NORMALIZE_NO:
+            ptr = inout;
+            /* 0.5 coeff comes from fftpack defining DCT as
+             * 4 * sum(cos(something)), whereas most definition 
+             * use 2 */
+            for (i = n * howmany - 1; i >= 0; --i, ++ptr) {
+                *((float *) (ptr)) *= 0.5;
             }
-        } 
-		break;
-	default:
-        fprintf(stderr, "dct2: normalize not yet supported=%d\n",
-                        normalize);
-		break;
+            break;
+        case DCT_NORMALIZE_ORTHONORMAL:
+            ptr = inout;
+            /* 0.5 coeff comes from fftpack defining DCT as
+             * 4 * sum(cos(something)), whereas most definition 
+             * use 2 */
+            n1 = 0.25 * sqrt(1./n);
+            n2 = 0.25 * sqrt(2./n);
+            for (i = 0; i < howmany; ++i, ptr+=n) {
+                ptr[0] *= n1;
+                for (j = 1; j < n; ++j) {
+                    ptr[j] *= n2;
+                }
+            } 
+            break;
+        default:
+            fprintf(stderr, "dct2: normalize not yet supported=%d\n",
+                    normalize);
+            break;
     }
 }



More information about the Scipy-svn mailing list