Skip to content

Commit 801b62a

Browse files
committed
fixed expected cells
1 parent 5d8b0e7 commit 801b62a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sbf.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ void SBF::PrintFilter(int mode)
297297
printf("Area-related parameters:\n");
298298
for(int j = 1; j < this->AREA_number+1; j++){
299299
potential_elements = (this->AREA_members[j]*this->HASH_number)-this->AREA_self_collisions[j];
300-
printf("Area %d: %d members, %.5f expected cells, %d cells out of %d potential (%d self-collisions)",j,this->AREA_members[j],this->AREA_expected_cells[j],this->AREA_cells[j],potential_elements,this->AREA_self_collisions[j]);
300+
printf("Area %d: %d members, %d expected cells, %d cells out of %d potential (%d self-collisions)",j,this->AREA_members[j],this->AREA_expected_cells[j],this->AREA_cells[j],potential_elements,this->AREA_self_collisions[j]);
301301
printf("\n");
302302
}
303303

@@ -560,9 +560,9 @@ void SBF::SetExpectedAreaCells()
560560
p2 = (double)pow(p1, this->HASH_number*nfill);
561561
p1 = (double)(1 - (double)pow(p1, this->HASH_number*this->AREA_members[i]));
562562

563-
p1 = (double)this->cells*p1*p2;
563+
p1 = (double)(this->cells*p1*p2);
564564

565-
this->AREA_expected_cells[i] = (float)p1;
565+
this->AREA_expected_cells[i] = (int)round(p1);
566566

567567
}
568568
}

sbf.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ namespace sbf {
6969
float safeness;
7070
int AREA_number;
7171
int *AREA_members;
72-
float *AREA_expected_cells;
72+
int *AREA_expected_cells;
7373
int *AREA_cells;
7474
int *AREA_self_collisions;
7575
float *AREA_a_priori_fpp;
@@ -180,7 +180,7 @@ namespace sbf {
180180
// Memory allocations for area related parameters
181181
this->AREA_members = new int[this->AREA_number + 1];
182182
this->AREA_cells = new int[this->AREA_number + 1];
183-
this->AREA_expected_cells = new float[this->AREA_number + 1];
183+
this->AREA_expected_cells = new int[this->AREA_number + 1];
184184
this->AREA_self_collisions = new int[this->AREA_number + 1];
185185
this->AREA_fpp = new float[this->AREA_number + 1];
186186
this->AREA_isep = new float[this->AREA_number + 1];

0 commit comments

Comments
 (0)