2005-01-12 jrandom

* Only create the loadtest.log if requested to do so (thanks zzz!)
    * Make sure we cleanly take into consideration the appropriate data
      points when filtering out duplicate messages in the message validator,
      and report the right bloom filter false positives rate (not used for
      anything except debugging)
This commit is contained in:
jrandom
2006-01-12 19:35:54 +00:00
committed by zzz
parent a638301b5c
commit 205d8de281
5 changed files with 32 additions and 17 deletions

View File

@ -112,6 +112,7 @@ public class BloomSHA1 {
for (int i = 0; i < filterWords; i++) {
filter[i] = 0;
}
count = 0;
}
/** Synchronized version */
public void clear() {
@ -198,7 +199,7 @@ public class BloomSHA1 {
public final double falsePositives(int n) {
// (1 - e(-kN/M))^k
return java.lang.Math.pow (
(1l - java.lang.Math.exp( ((double)k) * (long)n / (long)filterBits)), (long)k);
(1l - java.lang.Math.exp(0d- ((double)k) * (long)n / (long)filterBits)), (long)k);
}
public final double falsePositives() {