diff tests/pointset_test/genpoints2.c @ 286:fb8bec5c604e

generated points test, requires compile of audioDB with lshlib and -DQUERY_WITHOUT_NORM. Compares LSHLIB and EXACT retrieval of points on spherical shells at several radii
author mas01mc
date Tue, 15 Jul 2008 20:46:25 +0000
parents 781b129925ff
children 40dca0cbbffd
line wrap: on
line diff
--- a/tests/pointset_test/genpoints2.c	Mon Jul 14 21:50:47 2008 +0000
+++ b/tests/pointset_test/genpoints2.c	Tue Jul 15 20:46:25 2008 +0000
@@ -49,19 +49,18 @@
     // Translate to (0,0,...,1)
     coords[dim-1]+=1.0; 
 
-    // Recompute norm-squared
+    // Compute distance to (0,0,...,1)
     nmsq = 0.0;
-    for (j = 0; j < dim; j++){
+    for (j = 0; j < dim-1; j++){
       nmsq += coords[j]*coords[j];
     }
-
     // Save last value to distance calulcation to query(0,0,...,1)
     double nth = coords[dim-1];
     // Output to ASCII terminal
     printf("(");
     for(j = 0; j < dim; j++)
       printf("%8.3f ", coords[j]);
-    printf(") d = %8.3f\n", sqrt(nmsq - nth*nth + (nth-1)*(nth-1)));
+    printf(") d = %8.3f\n", sqrt(nmsq + (nth-1)*(nth-1)));
     
 
     // Save single feature vector