# HG changeset patch # User mas01mc # Date 1220027993 0 # Node ID 57fde215d9130793429eda07a816816bf49f699e # Parent c93be2f3a674b710ecdf803f9606a34f27985d3f Fixed indexing error in non-large ADB introduced with large ADB. diff -r c93be2f3a674 -r 57fde215d913 index.cpp --- a/index.cpp Thu Aug 21 21:28:33 2008 +0000 +++ b/index.cpp Fri Aug 29 16:39:53 2008 +0000 @@ -91,12 +91,14 @@ error("INDEXed database must be power-enabled", dbName); } - double *snpp = *snp, *sppp = 0; + double *snpp = 0, *sppp = 0; *dvp = dbH->length / (dbH->dim * sizeof(double)); // number of database vectors *snp = new double[*dvp]; // songs norm pointer: L2 norm table for each vector + snpp = *snp; *spp = new double[*dvp]; // song powertable pointer sppp = *spp; + memcpy(*snp, l2normTable, *dvp * sizeof(double)); memcpy(*spp, powerTable, *dvp * sizeof(double)); diff -r c93be2f3a674 -r 57fde215d913 tests/0020/run-test.sh --- a/tests/0020/run-test.sh Thu Aug 21 21:28:33 2008 +0000 +++ b/tests/0020/run-test.sh Fri Aug 29 16:39:53 2008 +0000 @@ -24,11 +24,12 @@ floatstring 0 0.5 >> testquery ${AUDIODB} -c localhost:10020 -d testdb -Q sequence -l 1 -f testquery -R 5 > testoutput -echo testfeature01 1 > test-expected-output -echo testfeature10 1 >> test-expected-output +echo testfeature01 0 0 0 > test-expected-output +echo testfeature10 2 0 0 >> test-expected-output cmp testoutput test-expected-output + ${AUDIODB} -c localhost:10020 -d testdb -Q sequence -l 1 -f testquery -r 1 -R 5 > testoutput -echo testfeature01 1 > test-expected-output +echo testfeature01 0 0 0 > test-expected-output cmp testoutput test-expected-output check_server $! @@ -43,9 +44,10 @@ # results... ${AUDIODB} -c localhost:10020 -d testdb -Q sequence -l 1 -f testquery -R 5 > testoutput -echo testfeature01 1 > test-expected-output -echo testfeature10 1 >> test-expected-output +echo testfeature01 0 0 0> test-expected-output +echo testfeature10 2 0 0>> test-expected-output cmp testoutput test-expected-output + ${AUDIODB} -c localhost:10020 -d testdb -Q sequence -l 1 -f testquery -r 1 -R 5 > testoutput echo testfeature01 1 > test-expected-output cmp testoutput test-expected-output