comparison index.cpp @ 311:cac5b3465318

Added sequencehop on Indexing to optionally reduce size of large indexes. Added cleanup() call on WS query exit to fix MMAP memory leak
author mas01mc
date Sat, 09 Aug 2008 15:04:16 +0000
parents 896679d8cc39
children b9eff6896943 c93be2f3a674
comparison
equal deleted inserted replaced
310:435ffdaecae9 311:cac5b3465318
283 } 283 }
284 284
285 Uns32T audioDB::index_insert_shingles(vector<vector<float> >* vv, Uns32T trackID, double* spp){ 285 Uns32T audioDB::index_insert_shingles(vector<vector<float> >* vv, Uns32T trackID, double* spp){
286 Uns32T collisionCount = 0; 286 Uns32T collisionCount = 0;
287 cout << "[" << trackID << "]" << fileTable+trackID*O2_FILETABLE_ENTRY_SIZE; 287 cout << "[" << trackID << "]" << fileTable+trackID*O2_FILETABLE_ENTRY_SIZE;
288 for( Uns32T pointID=0 ; pointID < (*vv).size(); pointID++) 288 for( Uns32T pointID=0 ; pointID < (*vv).size(); pointID+=sequenceHop)
289 if(!use_absolute_threshold || (use_absolute_threshold && (*spp++ >= absolute_threshold))) 289 if(!use_absolute_threshold || (use_absolute_threshold && (*spp >= absolute_threshold))){
290 collisionCount += lsh->insert_point((*vv)[pointID], index_from_trackInfo(trackID, pointID)); 290 collisionCount += lsh->insert_point((*vv)[pointID], index_from_trackInfo(trackID, pointID));
291 spp+=sequenceHop;
292 }
291 return collisionCount; 293 return collisionCount;
292 } 294 }
293 295
294 /********************* LSH shingle construction ***************************/ 296 /********************* LSH shingle construction ***************************/
295 297
379 } 381 }
380 382
381 lsh = index_allocate(indexName, false); // Get the header only here 383 lsh = index_allocate(indexName, false); // Get the header only here
382 sequenceLength = lsh->get_lshHeader()->dataDim / dbH->dim; // shingleDim / vectorDim 384 sequenceLength = lsh->get_lshHeader()->dataDim / dbH->dim; // shingleDim / vectorDim
383 385
384 if(!SERVER_LSH_INDEX_SINGLETON){ 386 if(lsh!=SERVER_LSH_INDEX_SINGLETON){
385 if( fabs(radius - lsh->get_radius())>fabs(O2_DISTANCE_TOLERANCE)) 387 if( fabs(radius - lsh->get_radius())>fabs(O2_DISTANCE_TOLERANCE))
386 printf("*** Warning: adb_radius (%f) != lsh_radius (%f) ***\n", radius, lsh->get_radius()); 388 printf("*** Warning: adb_radius (%f) != lsh_radius (%f) ***\n", radius, lsh->get_radius());
387 printf("INDEX: dim %d\n", dbH->dim); 389 printf("INDEX: dim %d\n", dbH->dim);
388 printf("INDEX: R %f\n", lsh->get_radius()); 390 printf("INDEX: R %f\n", lsh->get_radius());
389 printf("INDEX: seqlen %d\n", sequenceLength); 391 printf("INDEX: seqlen %d\n", sequenceLength);