Mercurial > hg > audiodb
changeset 190:f56c530750da no-big-mmap
remove two more uses of dataBuf
Instead of using the newly-inserted vectors to compute the L2 norms, we
can use the input files' data.
author | mas01cr |
---|---|
date | Fri, 16 Nov 2007 18:21:37 +0000 |
parents | 0280c3f57b6f |
children | b7400fabbb94 |
files | audioDB.cpp |
diffstat | 1 files changed, 3 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/audioDB.cpp Fri Nov 16 16:55:40 2007 +0000 +++ b/audioDB.cpp Fri Nov 16 18:21:37 2007 +0000 @@ -619,7 +619,7 @@ // Norm the vectors on input if the database is already L2 normed if(dbH->flags & O2_FLAG_L2NORM) - unitNormAndInsertL2((double*)(((char *) dataBuf) + insertoffset), dbH->dim, numVectors, 1); // append + unitNormAndInsertL2((double *)(indata + sizeof(int)), dbH->dim, numVectors, 1); // append // Report status status(dbName); @@ -790,7 +790,7 @@ // Norm the vectors on input if the database is already L2 normed if(dbH->flags & O2_FLAG_L2NORM) - unitNormAndInsertL2((double*)(((char *) dataBuf) + insertoffset), dbH->dim, numVectors, 1); // append + unitNormAndInsertL2((double *)(indata + sizeof(int)), dbH->dim, numVectors, 1); // append totalVectors+=numVectors; @@ -1085,7 +1085,7 @@ // For each input vector, find the closest pointNN matching output vectors and report // we use stdout in this stub version unsigned numVectors = (statbuf.st_size-sizeof(int))/(sizeof(double)*dbH->dim); - + double* query = (double*)(indata+sizeof(int)); double* data = dataBuf; double* queryCopy = 0; @@ -2640,14 +2640,6 @@ p++; } l2ptr++; - /* - oneOverL2 = 1.0/(*l2ptr++); - d=dim; - while(d--){ - *X*=oneOverL2; - X++; - } - */ X+=dim; } unsigned offset;