Mercurial > hg > audiodb
changeset 520:0767731a6cce multiprobeLSH
Fixed boundary {-1,+1} order, array syntax in generate_multiprobe_keys(), boundary error in MultiProbe::valid()
author | mas01mc |
---|---|
date | Mon, 26 Jan 2009 13:19:09 +0000 |
parents | fdcd436d7cbd |
children | 237d5a03d317 |
files | Makefile lshlib.cpp multiprobe.cpp |
diffstat | 3 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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;
--- 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<sorted_distance_functions>(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<sorted_distance_functions>(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;