comparison index.cpp @ 463:35bb388d0eac api-inversion

audioDB::query_loop and audioDB::query_loop_points are no more. Be a little bit careful about deleting the exact_evaluation_queue in error conditions, but otherwise this was simple (If you ignore the work of the previous $N$ commits, that is). The inversion work in query.cpp is now complete, apart from physically teasing apart the API function from the body of audioDB::query and then moving the two remaining audioDB:: methods elsewhere. Unfortunately, we're still not quite done, because we have to deal with audioDB::index_query_loop too, which is still a little bit tangled. Still, we're nearly there...
author mas01cr
date Tue, 30 Dec 2008 15:38:59 +0000
parents 17003dff8127
children 1030664df98c
comparison
equal deleted inserted replaced
462:f689510baaf4 463:35bb388d0eac
575 r.ipos = spos; 575 r.ipos = spos;
576 qstate->accumulator->add_point(&r); 576 qstate->accumulator->add_point(&r);
577 } 577 }
578 } 578 }
579 579
580 // Maintain a queue of points to pass to query_loop_points() for exact 580 // Maintain a queue of points to pass to audiodb_query_queue_loop()
581 // evaluation 581 // for exact evaluation
582 void audiodb_index_add_point_exact(void *user_data, Uns32T pointID, Uns32T qpos, float dist) { 582 void audiodb_index_add_point_exact(void *user_data, Uns32T pointID, Uns32T qpos, float dist) {
583 adb_qcallback_t *data = (adb_qcallback_t *) user_data; 583 adb_qcallback_t *data = (adb_qcallback_t *) user_data;
584 adb_t *adb = data->adb; 584 adb_t *adb = data->adb;
585 adb_qstate_internal_t *qstate = data->qstate; 585 adb_qstate_internal_t *qstate = data->qstate;
586 uint32_t nbits = audiodb_lsh_n_point_bits(adb); 586 uint32_t nbits = audiodb_lsh_n_point_bits(adb);
665 } 665 }
666 audiodb_index_delete_shingles(vv); 666 audiodb_index_delete_shingles(vv);
667 667
668 if(lsh_exact) 668 if(lsh_exact)
669 // Perform exact distance computation on point pairs in exact_evaluation_queue 669 // Perform exact distance computation on point pairs in exact_evaluation_queue
670 query_loop_points(adb, spec, qstate, query, &qpointers); 670 audiodb_query_queue_loop(adb, spec, qstate, query, &qpointers);
671 671
672 // Close the index file 672 // Close the index file
673 close(lshfid); 673 close(lshfid);
674 674
675 // Clean up 675 // Clean up