# HG changeset patch # User mas01mc # Date 1233028159 0 # Node ID 237d5a03d31796eff010577895b80414d7ed07e4 # Parent 0767731a6ccecb7eb6b60704234a34b51fde6190 Working version of multiprobe LSH. Passes tests. But needs testing vis-a-vis TP improvement. In the process, found a bug in hash function projections on rare occasions admitting negative values. This only shows for large datasets and was fatal for multiprobe. diff -r 0767731a6cce -r 237d5a03d317 Makefile --- a/Makefile Mon Jan 26 13:19:09 2009 +0000 +++ b/Makefile Tue Jan 27 03:49:19 2009 +0000 @@ -17,7 +17,7 @@ MINORVERSION=0 LIBRARY=lib$(EXECUTABLE).so.$(SOVERSION).$(MINORVERSION) -override CFLAGS+=-g -ggdb -fPIC +override CFLAGS+=-O3 -g -fPIC # set to DUMP hashtables on QUERY load #override CFLAGS+=-DLSH_DUMP_CORE_TABLES diff -r 0767731a6cce -r 237d5a03d317 lshlib.cpp --- a/lshlib.cpp Mon Jan 26 13:19:09 2009 +0000 +++ b/lshlib.cpp Tue Jan 27 03:49:19 2009 +0000 @@ -324,7 +324,10 @@ tmp += *pA++ * *vi++; // project tmp += *pb; // translate tmp *= iw; // scale - *pg = (Uns32T) (floor(tmp)); // hash function g_j(v)=[x1 x2 ... xk]; xk \in Z + tmp = floor(tmp); // handle negative values + while(tmp<0) // wrap around 0 to N + tmp += H::N; + *pg = (Uns32T) tmp; // hash function g_j(v)=[x1 x2 ... xk]; xk \in Z *bd = (tmp - *pg++);//*w; // boundary distance -1 *(bd+1) = (1.0f - *bd); //*w; // boundary distance +1 bd+=2;