# HG changeset patch # User mas01cr # Date 1230116112 0 # Node ID c6046dd8057008b958d51f2e041779d38429cf74 # Parent b09d2eb1a2b20c3e755585042c3efda7f5eac6f8 Accumulators everywhere! Now all codepaths go through accumulators, and the reporter is only used right at the very end. diff -r b09d2eb1a2b2 -r c6046dd80570 index.cpp --- a/index.cpp Wed Dec 24 10:55:08 2008 +0000 +++ b/index.cpp Wed Dec 24 10:55:12 2008 +0000 @@ -540,8 +540,14 @@ Uns32T trackID = index_to_trackID(pointID, myself->lsh_n_point_bits); Uns32T spos = index_to_trackPos(pointID, myself->lsh_n_point_bits); // Skip identity in query_from_key - if( !myself->query_from_key || (myself->query_from_key && ( trackID != myself->query_from_key_index )) ) - myself->reporter->add_point(trackID, qpos, spos, dist); + if( !myself->query_from_key || (myself->query_from_key && ( trackID != myself->query_from_key_index )) ) { + adb_result_t r; + r.key = myself->fileTable + trackID * O2_FILETABLE_ENTRY_SIZE; + r.dist = dist; + r.qpos = qpos; + r.ipos = spos; + myself->accumulator->add_point(&r); + } } // *Static* exact NN point reporter callback method for lshlib diff -r b09d2eb1a2b2 -r c6046dd80570 query.cpp --- a/query.cpp Wed Dec 24 10:55:08 2008 +0000 +++ b/query.cpp Wed Dec 24 10:55:12 2008 +0000 @@ -639,8 +639,14 @@ dist = qn*qn + sn*sn - 2*dist; // else // dist = dist; - if((!radius) || dist <= (O2_LSH_EXACT_MULT*radius+O2_DISTANCE_TOLERANCE)) - reporter->add_point(pp.trackID, pp.qpos, pp.spos, dist); + if((!radius) || dist <= (O2_LSH_EXACT_MULT*radius+O2_DISTANCE_TOLERANCE)) { + adb_result_t r; + r.key = fileTable + pp.trackID * O2_FILETABLE_ENTRY_SIZE; + r.dist = dist; + r.qpos = pp.qpos; + r.ipos = pp.spos; + accumulator->add_point(&r); + } } exact_evaluation_queue->pop(); }