diff sample.cpp @ 269:dcbb30790b30 sampling

Whoops. Fix EXTREMELY EMBARRASSING bug in distance computation.
author mas01cr
date Mon, 16 Jun 2008 11:57:25 +0000
parents 30a2a45f2b70
children 9636040ff503
line wrap: on
line diff
--- a/sample.cpp	Mon Jun 16 11:15:15 2008 +0000
+++ b/sample.cpp	Mon Jun 16 11:57:25 2008 +0000
@@ -127,7 +127,7 @@
       /* assume normalizedDistance == true for now */
       /* FIXME: not convinced that the statistics we calculated in
 	 TASLP paper are valid for normalizedDistance */
-      double dist = 2 - v1v2 / sqrt(v1norm * v2norm);
+      double dist = 2 - 2 * v1v2 / sqrt(v1norm * v2norm);
       VERB_LOG(1, "%f %f\n", dist, log(dist));
       sumdist += dist;
       sumlogdist += log(dist);