#include "platform.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
◆ MAX_IBF_DECODE
#define MAX_IBF_DECODE 16 |
◆ ROUNDS
◆ FIX1
◆ FIX2
◆ STRATA
◆ VERBOSE
◆ SLOW
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 54 of file ibf_sim.c.
57 unsigned int buckets[31];
62 unsigned long long total;
66 srandom (time (NULL));
68 want = atoi (argv[1]);
69 for (round = 0; round <
ROUNDS; round++)
71 memset (buckets, 0,
sizeof(buckets));
72 for (i = 0; i < want; i++)
80 for (j = 0; (j < 31) && (0 == (r & (1 << j))); j++)
84 j = __builtin_ffs (r) - 1;
90 for (j = 31; j >= 0; j--)
100 ret *= (1 << (j + 1));
113 ret *= (1 << (j + 1));
122 ret *= (1 << (j + 1));
127 predict = (buckets[j] + 2.0 * predict) / 2.0;
130 fprintf (stderr,
"%u ",
ret);
134 fprintf (stderr,
"\n");
135 fprintf (stdout,
"average %llu\n", total /
ROUNDS);
static int ret
Return value of the commandline.
References MAX_IBF_DECODE, ret, and ROUNDS.