# HG changeset patch # User mas01cr # Date 1190278235 0 # Node ID 944f05e65a5886c7a41f5e65e0c8eb07e44865c2 # Parent b46c50dfd3ee9c483cff877997701a57adef9adb Fix what is I think an off-by-one in query and sequence searching. When taking the mean of the N minimum distances, only consider those distances which are closer than the infinite/uninitialized distance. (This renders us potentially vulnerable to an internal consistency horror where we end up trying to divide by zero. This is unlikely to be picked up by unit tests, but might well be by random tests if this is in fact a problem.) diff -r b46c50dfd3ee -r 944f05e65a58 audioDB.cpp --- a/audioDB.cpp Wed Sep 19 15:10:51 2007 +0000 +++ b/audioDB.cpp Thu Sep 20 08:50:35 2007 +0000 @@ -1770,8 +1770,8 @@ } // Search for minimum distance by shingles (concatenated vectors) - for(j=0;j10) cerr << thisDist << " " << qNorm[j] << " " << sNorm[trackIndexOffset+k] << endl; @@ -1820,9 +1820,11 @@ } // Calculate the mean of the N-Best matches thisDist=0.0; - for(m=0; m3)