# HG changeset patch # User mas01mc # Date 1231539177 0 # Node ID fd890d2b38dac81a1756a5cbd283edb7ef2faa62 # Parent f9d86b1db21c7dc962ef8ca8aac0b2d4cb09b1d7 modified point-bits coding for indexing (BREAKS BACKWARDS COMPATIBILITY). Plugged file-descriptor leak in index.cpp diff -r f9d86b1db21c -r fd890d2b38da Makefile --- a/Makefile Fri Jan 09 18:05:32 2009 +0000 +++ b/Makefile Fri Jan 09 22:12:57 2009 +0000 @@ -71,7 +71,7 @@ clean: - -rm cmdline.c cmdline.h + -rm cmdline.c cmdline.h cmdline.o -rm soapServer.cpp soapClient.cpp soapC.cpp soapObject.h soapStub.h soapProxy.h soapH.h soapServerLib.cpp soapClientLib.cpp -rm adb.* -rm HELP.txt diff -r f9d86b1db21c -r fd890d2b38da create.cpp --- a/create.cpp Fri Jan 09 18:05:32 2009 +0000 +++ b/create.cpp Fri Jan 09 22:12:57 2009 +0000 @@ -55,11 +55,11 @@ // For backward-compatibility, Record the point-encoding parameter for LSH indexing in the adb header // If this value is 0 then it will be set to 14 - //#if O2_LSH_N_POINT_BITS > 28 - //#error "AudioDB Compile ERROR: consistency check of O2_LSH_POINT_BITS failed (>15)" - //#endif + #if LSH_N_POINT_BITS > 31 + #error "AudioDB Compile ERROR: consistency check of O2_LSH_POINT_BITS failed (>31)" + #endif - dbH->flags |= LSH_N_POINT_BITS << 28; + dbH->flags |= LSH_N_POINT_BITS << 27; // If database will fit in a single file the vectors are copied into the AudioDB instance // Else all the vectors are left on the FileSystem and we use the dataOffset as storage diff -r f9d86b1db21c -r fd890d2b38da index.cpp --- a/index.cpp Fri Jan 09 18:05:32 2009 +0000 +++ b/index.cpp Fri Jan 09 22:12:57 2009 +0000 @@ -589,6 +589,7 @@ else set_up_query(&query_data, &query, &qNorm, &qnPtr, &qPower, &qpPtr, &meanQdur, &numVectors); // get query vectors + close(infid); // Free up this file handle VERB_LOG(1, "retrieving tracks..."); assert(pointNN>0 && pointNN<=O2_MAXNN); diff -r f9d86b1db21c -r fd890d2b38da query.cpp --- a/query.cpp Fri Jan 09 18:05:32 2009 +0000 +++ b/query.cpp Fri Jan 09 22:12:57 2009 +0000 @@ -70,10 +70,20 @@ } break; case O2_ONE_TO_ONE_N_SEQUENCE_QUERY : + if(no_unit_norming) + normalizedDistance = false; if(radius == 0) { error("query-type not yet supported"); - } else { - reporter = new trackSequenceQueryRadNNReporterOneToOne(pointNN,trackNN, dbH->numFiles); + } + else { + if(index_exists(dbName, radius, sequenceLength)){ + char* indexName = index_get_name(dbName, radius, sequenceLength); + lsh = index_allocate(indexName, false); + reporter = new trackSequenceQueryRadNNReporterOneToOne(pointNN,trackNN, index_to_trackID(lsh->get_maxp(), lsh_n_point_bits)+1); + delete[] indexName; + } + else + reporter = new trackSequenceQueryRadNNReporterOneToOne(pointNN,trackNN, dbH->numFiles); } break; default: