@@ -267,6 +267,7 @@ void SBF::PrintFilter(int mode)
267
267
printf (" Filter sparsity: %.5f\n " ,this ->GetFilterSparsity ());
268
268
printf (" Filter a-priori fpp: %.5f\n " , this ->GetFilterAPrioriFpp ());
269
269
printf (" Filter fpp: %.5f\n " ,this ->GetFilterFpp ());
270
+ printf (" Filter a-priori safeness probability: %.5f\n " , this ->safeness );
270
271
printf (" Number of mapped elements: %d\n " ,this ->members );
271
272
printf (" Number of hash collisions: %d\n " ,this ->collisions );
272
273
@@ -302,7 +303,7 @@ void SBF::PrintFilter(int mode)
302
303
303
304
printf (" \n Emersion, Fpp, Isep:\n " );
304
305
for (int j = 1 ; j < this ->AREA_number +1 ; j++){
305
- printf (" Area %d: expected emersion %.5f, emersion %.5f, a-priori fpp %.5f, fpp %.5f, a-priori isep %.5f, expected ise %.5f, isep %.5f" ,j,this ->GetExpectedAreaEmersion (j),this ->GetAreaEmersion (j),this ->AREA_a_priori_fpp [j],this ->AREA_fpp [j],this ->AREA_a_priori_isep [j], this ->AREA_a_priori_isep [j]*this ->AREA_members [j], this ->AREA_isep [j]);
306
+ printf (" Area %d: expected emersion %.5f, emersion %.5f, a-priori fpp %.5f, fpp %.5f, a-priori isep %.5f, expected ise %.5f, isep %.5f, a-priori safep %.5f " ,j,this ->GetExpectedAreaEmersion (j),this ->GetAreaEmersion (j),this ->AREA_a_priori_fpp [j],this ->AREA_fpp [j],this ->AREA_a_priori_isep [j], this ->AREA_a_priori_isep [j]*this ->AREA_members [j], this ->AREA_isep [j], this -> AREA_a_priori_safep [j]);
306
307
printf (" \n " );
307
308
}
308
309
printf (" \n " );
@@ -335,11 +336,12 @@ void SBF::SaveToDisk(std::string path, int mode)
335
336
myfile << " sparsity" << " ;" << this ->GetFilterSparsity () << std::endl;
336
337
myfile << " a-priori fpp" << " ;" << this ->GetFilterAPrioriFpp () << std::endl;
337
338
myfile << " fpp" << " ;" << this ->GetFilterFpp () << std::endl;
339
+ myfile << " a-priori safeness probability" << " ;" << this ->safeness << std::endl;
338
340
// area-related parameters:
339
- // area,members,expected cells,self-collisions,cells,expected emersion,emersion,a-priori fpp,fpp,a-priori isep,expected ise,isep
340
- myfile << " area" << " ;" << " members" << " ;" << " expected cells" << " ;" << " self-collisions" << " ;" << " cells" << " ;" << " expected emersion" << " ;" << " emersion" << " ;" << " a-priori fpp" << " ;" << " fpp" << " ;" << " a-priori isep" << " ;" << " expected ise" << " ;" << " isep" << std::endl;
341
+ // area,members,expected cells,self-collisions,cells,expected emersion,emersion,a-priori fpp,fpp,a-priori isep,expected ise,isep,a-priori safep
342
+ myfile << " area" << " ;" << " members" << " ;" << " expected cells" << " ;" << " self-collisions" << " ;" << " cells" << " ;" << " expected emersion" << " ;" << " emersion" << " ;" << " a-priori fpp" << " ;" << " fpp" << " ;" << " a-priori isep" << " ;" << " expected ise" << " ;" << " isep" << " ; " << " a-priori safep " << std::endl;
341
343
for (int j = 1 ; j < this ->AREA_number +1 ; j++){
342
- myfile << j << " ;" << this ->AREA_members [j] << " ;" << this ->AREA_expected_cells [j] << " ;" << this ->AREA_self_collisions [j] << " ;" << this ->AREA_cells [j] << " ;" << this ->GetExpectedAreaEmersion (j) << " ;" << this ->GetAreaEmersion (j) << " ;" << this ->AREA_a_priori_fpp [j] << " ;" << this ->AREA_fpp [j] << " ;" << this ->AREA_a_priori_isep [j] << " ;" << (float )this ->AREA_members [j] * this ->AREA_a_priori_isep [j] << " ;" << (float )this ->AREA_isep [j] << std::endl;
344
+ myfile << j << " ;" << this ->AREA_members [j] << " ;" << this ->AREA_expected_cells [j] << " ;" << this ->AREA_self_collisions [j] << " ;" << this ->AREA_cells [j] << " ;" << this ->GetExpectedAreaEmersion (j) << " ;" << this ->GetAreaEmersion (j) << " ;" << this ->AREA_a_priori_fpp [j] << " ;" << this ->AREA_fpp [j] << " ;" << this ->AREA_a_priori_isep [j] << " ;" << (float )this ->AREA_members [j] * this ->AREA_a_priori_isep [j] << " ;" << (float )this ->AREA_isep [j] << " ; " << this -> AREA_a_priori_safep [j] << std::endl;
343
345
}
344
346
345
347
}
@@ -489,11 +491,14 @@ int SBF::Check(char *string, int size)
489
491
490
492
491
493
// Computes a-priori area-specific inter-set error probability (a_priori_isep)
494
+ // Computes a-priori area-specific safeness probability (a_priori_safep) and
495
+ // the overall safeness probability for the entire filter
492
496
void SBF::SetAPrioriAreaIsep ()
493
497
{
494
- double p ;
498
+ double p1, p2, p3 ;
495
499
int nfill;
496
500
501
+ p3 = 1 ;
497
502
498
503
for (int i = this ->AREA_number ; i>0 ; i--) {
499
504
nfill = 0 ;
@@ -502,13 +507,22 @@ void SBF::SetAPrioriAreaIsep()
502
507
nfill += this ->AREA_members [j];
503
508
}
504
509
505
- p = (double )(1 - 1 / (double )this ->cells );
506
- p = (double )(1 - (double )pow (p , this ->HASH_number *nfill));
507
- p = (double )pow (p , this ->HASH_number );
510
+ p1 = (double )(1 - 1 / (double )this ->cells );
511
+ p1 = (double )(1 - (double )pow (p1 , this ->HASH_number *nfill));
512
+ p1 = (double )pow (p1 , this ->HASH_number );
508
513
509
- this ->AREA_a_priori_isep [i] = (float )p;
514
+ p2 = (double )(1 - p1);
515
+ p2 = (double )pow (p2, this ->AREA_members [i]);
516
+
517
+ p3 *= p2;
518
+
519
+ this ->AREA_a_priori_isep [i] = (float )p1;
520
+ this ->AREA_a_priori_safep [i] = (float )p2;
510
521
511
522
}
523
+
524
+ this ->safeness = (float )p3;
525
+
512
526
}
513
527
514
528
0 commit comments