[Scipy-svn] r5204 - trunk/scipy/cluster/src

scipy-svn@scip... scipy-svn@scip...
Sat Nov 29 04:53:20 CST 2008


Author: stefan
Date: 2008-11-29 04:53:10 -0600 (Sat, 29 Nov 2008)
New Revision: 5204

Modified:
   trunk/scipy/cluster/src/vq.c
Log:
Remove tabs and clean whitespace at end of lines.

Modified: trunk/scipy/cluster/src/vq.c
===================================================================
--- trunk/scipy/cluster/src/vq.c	2008-11-27 20:15:45 UTC (rev 5203)
+++ trunk/scipy/cluster/src/vq.c	2008-11-29 10:53:10 UTC (rev 5204)
@@ -18,8 +18,8 @@
 
 
 #if 0
-static int float_vq_1d(const float *in, int n, 
-    const float *init, int ncode, 
+static int float_vq_1d(const float *in, int n,
+    const float *init, int ncode,
     npy_intp *code, float *mdist)
 {
     int i, j;
@@ -46,46 +46,46 @@
     float *code_book, int Ncodes, int Nfeatures,
        npy_intp* code, float *lowest_dist)
 {
-	int i,j,k=0;
-	float dist, diff;
+        int i,j,k=0;
+        float dist, diff;
 
-	*lowest_dist = (float) rbig;
-	for(i = 0; i < Ncodes; i++) {
-		dist = 0;
-		for(j=0; j < Nfeatures; j++) {
-			diff = code_book[k] - obs[j];
-			dist += diff*diff;
-			k++;
-		}
-		dist = (float)sqrt(dist);
-		if (dist < *lowest_dist) {
-			*code = i;
-			*lowest_dist = dist;
-		}
-	}
+        *lowest_dist = (float) rbig;
+        for(i = 0; i < Ncodes; i++) {
+                dist = 0;
+                for(j=0; j < Nfeatures; j++) {
+                        diff = code_book[k] - obs[j];
+                        dist += diff*diff;
+                        k++;
+                }
+                dist = (float)sqrt(dist);
+                if (dist < *lowest_dist) {
+                        *code = i;
+                        *lowest_dist = dist;
+                }
+        }
 
     return 0;
 }
 
 int float_tvq(
     float* obs,
-    float* code_book, 
+    float* code_book,
     int Nobs, int Ncodes, int Nfeatures,
     npy_intp* codes, float* lowest_dist)
 {
     int i;
-	for( i = 0; i < Nobs; i++) {		
-		float_vq_obs(
+        for( i = 0; i < Nobs; i++) {
+                float_vq_obs(
                     &(obs[i*Nfeatures]),
                     code_book,Ncodes, Nfeatures,
                     &(codes[i]), &(lowest_dist[i]));
-	}
+        }
     return 0;
 }
 
 #if 0
-static int double_vq_1d(const double *in, int n, 
-    const double *init, int ncode, 
+static int double_vq_1d(const double *in, int n,
+    const double *init, int ncode,
     npy_intp *code, double *mdist)
 {
     int i, j;
@@ -112,40 +112,39 @@
     double *code_book, int Ncodes, int Nfeatures,
        npy_intp* code, double *lowest_dist)
 {
-	int i,j,k=0;
-	double dist, diff;
+        int i,j,k=0;
+        double dist, diff;
 
-	*lowest_dist = (double) rbig;
-	for(i = 0; i < Ncodes; i++) {
-		dist = 0;
-		for(j=0; j < Nfeatures; j++) {
-			diff = code_book[k] - obs[j];
-			dist += diff*diff;
-			k++;
-		}
-		dist = (double)sqrt(dist);
-		if (dist < *lowest_dist) {
-			*code = i;
-			*lowest_dist = dist;
-		}
-	}
+        *lowest_dist = (double) rbig;
+        for(i = 0; i < Ncodes; i++) {
+                dist = 0;
+                for(j=0; j < Nfeatures; j++) {
+                        diff = code_book[k] - obs[j];
+                        dist += diff*diff;
+                        k++;
+                }
+                dist = (double)sqrt(dist);
+                if (dist < *lowest_dist) {
+                        *code = i;
+                        *lowest_dist = dist;
+                }
+        }
 
     return 0;
 }
 
 int double_tvq(
     double* obs,
-    double* code_book, 
+    double* code_book,
     int Nobs, int Ncodes, int Nfeatures,
     npy_intp* codes, double* lowest_dist)
 {
     int i;
-	for( i = 0; i < Nobs; i++) {		
-		double_vq_obs(
+        for( i = 0; i < Nobs; i++) {
+                double_vq_obs(
                     &(obs[i*Nfeatures]),
                     code_book,Ncodes, Nfeatures,
                     &(codes[i]), &(lowest_dist[i]));
-	}
+        }
     return 0;
 }
-



More information about the Scipy-svn mailing list