# HG changeset patch # User mas01cr # Date 1230116161 0 # Node ID e43f8a7aca93c655c44fd8b23dbdd62b13a4f285 # Parent 53c487885b2c9d16617c30f64a16392b85b8f923 really zap all unnecessary sequenceLength from query.cpp diff -r 53c487885b2c -r e43f8a7aca93 index.cpp --- a/index.cpp Wed Dec 24 10:55:56 2008 +0000 +++ b/index.cpp Wed Dec 24 10:56:01 2008 +0000 @@ -584,6 +584,7 @@ double meanQdur = 0; void (*add_point_func)(void*,Uns32T,Uns32T,float); + sequenceLength = spec->qid.sequence_length; normalizedDistance = (spec->params.distance == ADB_DISTANCE_EUCLIDEAN_NORMED); // Set the point-reporter callback based on the value of lsh_exact diff -r 53c487885b2c -r e43f8a7aca93 query.cpp --- a/query.cpp Wed Dec 24 10:55:56 2008 +0000 +++ b/query.cpp Wed Dec 24 10:56:01 2008 +0000 @@ -159,9 +159,7 @@ // Test for index (again) here if((qspec.refine.flags & ADB_REFINE_RADIUS) && index_exists(adb->path, qspec.refine.radius, qspec.qid.sequence_length)){ - /* FIXME: remaining use of sequenceLength */ - sequenceLength = qspec.qid.sequence_length; - VERB_LOG(1, "Calling indexed query on database %s, radius=%f, sequenceLength=%d\n", adb->path, qspec.refine.radius, sequenceLength); + VERB_LOG(1, "Calling indexed query on database %s, radius=%f, sequence_length=%d\n", adb->path, qspec.refine.radius, qspec.qid.sequence_length); index_query_loop(&qspec, dbName, query_from_key_index); } else{ @@ -376,7 +374,7 @@ if(usingQueryPoint) { if( !(queryPoint < *nvp && queryPoint < *nvp - sequence_length + 1) ) { - error("queryPoint >= numVectors-sequenceLength+1 in query"); + error("queryPoint >= numVectors-sequence_length+1 in query"); } else { VERB_LOG(1, "query point: %u\n", queryPoint); *vqp = *qp + queryPoint * dbH->dim; @@ -486,7 +484,7 @@ if(usingQueryPoint) { if( !(queryPoint < *nvp && queryPoint < *nvp - sequence_length + 1) ) { - error("queryPoint >= numVectors-sequenceLength+1 in query"); + error("queryPoint >= numVectors-sequence_length+1 in query"); } else { VERB_LOG(1, "query point: %u\n", queryPoint); *vqp = *qp + queryPoint * dbH->dim; @@ -594,6 +592,8 @@ double *sNorm = 0, *snPtr, *sPower = 0, *spPtr = 0; double *meanDBdur = 0; + uint32_t sequence_length = spec->qid.sequence_length; + // check pre-conditions assert(exact_evaluation_queue&&reporter); if(!exact_evaluation_queue->size()) // Exit if no points to evaluate @@ -659,7 +659,7 @@ Uns32T sPos = trackIndexOffset+pp.spos; // index into l2norm table // Test power thresholds before computing distance if( ( !usingPower || audiodb_powers_acceptable(&spec->refine, qpPtr[qPos], sPower[sPos])) && - ( qPosflags & O2_FLAG_LARGE_ADB) && (currentTrack!=pp.trackID) ){ // On currentTrack change, allocate and load track data @@ -669,7 +669,7 @@ error("failed to read data"); } // Compute distance - dist = audiodb_dot_product(query+qPos*dbH->dim, data_buffer+pp.spos*dbH->dim, dbH->dim*sequenceLength); + dist = audiodb_dot_product(query+qPos*dbH->dim, data_buffer+pp.spos*dbH->dim, dbH->dim*sequence_length); double qn = qnPtr[qPos]; double sn = sNorm[sPos]; switch(spec->params.distance) {