# HG changeset patch # User mas01mc # Date 1232975949 0 # Node ID 0767731a6ccecb7eb6b60704234a34b51fde6190 # Parent fdcd436d7cbd6caaf1c5ae05930e87fdc9db81a9 Fixed boundary {-1,+1} order, array syntax in generate_multiprobe_keys(), boundary error in MultiProbe::valid() diff -r fdcd436d7cbd -r 0767731a6cce Makefile --- a/Makefile Mon Jan 26 05:42:15 2009 +0000 +++ b/Makefile Mon Jan 26 13:19:09 2009 +0000 @@ -17,7 +17,7 @@ MINORVERSION=0 LIBRARY=lib$(EXECUTABLE).so.$(SOVERSION).$(MINORVERSION) -override CFLAGS+=-O3 -g -fPIC +override CFLAGS+=-g -ggdb -fPIC # set to DUMP hashtables on QUERY load #override CFLAGS+=-DLSH_DUMP_CORE_TABLES diff -r fdcd436d7cbd -r 0767731a6cce lshlib.cpp --- a/lshlib.cpp Mon Jan 26 05:42:15 2009 +0000 +++ b/lshlib.cpp Mon Jan 26 13:19:09 2009 +0000 @@ -343,7 +343,7 @@ // according the the boundary distances of the current query void H::generate_multiprobe_keys(Uns32T*g, Uns32T* r1, Uns32T* r2){ assert(!multiProbePtr->empty()); // Test this for now, until all is stable - Uns32T* mpg = new Uns32T(H::k); // temporary array storage + Uns32T* mpg = new Uns32T[H::k]; // temporary array storage // Copy the hash bucket identifiers Uns32T* mpgPtr = mpg; diff -r fdcd436d7cbd -r 0767731a6cce multiprobe.cpp --- a/multiprobe.cpp Mon Jan 26 05:42:15 2009 +0000 +++ b/multiprobe.cpp Mon Jan 26 13:19:09 2009 +0000 @@ -169,7 +169,7 @@ delete distFuns; distFuns = new std::vector(numHashBoundaries); for(unsigned i = 0; i != numHashBoundaries ; i++ ) - (*distFuns)[i] = make_pair(x[i], make_pair(i, i%2?-1:1)); + (*distFuns)[i] = make_pair(x[i], make_pair(i, i%2?1:-1)); // SORT sort( distFuns->begin(), distFuns->end() ); } @@ -180,7 +180,7 @@ delete distFuns; distFuns = new std::vector(numHashBoundaries); for(unsigned i = 0; i != numHashBoundaries ; i++ ) - (*distFuns)[i] = make_pair(x[i], make_pair(i, i%2?-1:1)); + (*distFuns)[i] = make_pair(x[i], make_pair(i, i%2?1:-1)); // SORT sort( distFuns->begin(), distFuns->end() ); } @@ -209,7 +209,7 @@ while( it != a.end() ){ j = *it; it++; - if( ( (unsigned)j > numHashBoundaries ) || ( a.find( numHashBoundaries + 1 - j ) != a.end() ) ) + if( ( (unsigned)j > numHashBoundaries ) || ( a.find( numHashBoundaries - j - 1 ) != a.end() ) ) return false; } return true;