hashlookup / poppy

Rust implementation of the DCSO Bloom filter
BSD 3-Clause "New" or "Revised" License
25 stars 0 forks source link

handle false positive probability correctly #4

Open be-a-panther opened 2 days ago

be-a-panther commented 2 days ago

https://github.com/hashlookup/poppy/blob/28f37fac7ceb0184598831c755fd6e482dc5aa8a/poppy/src/bin/poppy.rs#L71

I would guess that the false positive probability is between 1 and 0, but that is not clear nor checked after setting this parameter. Maybe it is useful to clamp the value (https://doc.rust-lang.org/stable/core/primitive.f64.html#method.clamp)

I misunderstood this value as a percent value and this leads to funny results.

user@system:   wc -l result_*
     37 result_0.0001.txt
     37 result_0.001.txt
     37 result_0.01.txt
     37 result_0.1.txt
 712976 result_1.0.txt
    458 result_2.0.txt
    458 result_3.0.txt
     70 result_5.0.txt
     37 result_10.0.txt
     37 result_15.0.txt
qjerome commented 2 days ago

Hi @be-a-panther,

Thanks for reporting the issue. Yes indeed the value is supposed to be in ]0;1] I'll try to fix this asap